12.1.1 (#1819)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user