mirror of
https://github.com/pezkuwichain/pezkuwi-common.git
synced 2026-04-21 23:48:05 +00:00
11 lines
248 B
JavaScript
11 lines
248 B
JavaScript
export class TextEncoder {
|
|
encode(value) {
|
|
const count = value.length;
|
|
const u8a = new Uint8Array(count);
|
|
for (let i = 0; i < count; i++) {
|
|
u8a[i] = value.charCodeAt(i);
|
|
}
|
|
return u8a;
|
|
}
|
|
}
|