This commit is contained in:
Jaco
2023-04-29 08:44:25 +03:00
committed by GitHub
parent 6b1ff0036e
commit 770471aef0
30 changed files with 141 additions and 150 deletions
+3 -2
View File
@@ -4,9 +4,10 @@
// This is very limited, only handling Ascii values
export class TextEncoder {
encode (value: string): Uint8Array {
const u8a = new Uint8Array(value.length);
const count = value.length;
const u8a = new Uint8Array(count);
for (let i = 0; i < value.length; i++) {
for (let i = 0; i < count; i++) {
u8a[i] = value.charCodeAt(i);
}