Files
SerpentRace/SerpentRace_Backend/node_modules/web-encoding/test/ts-use/src/main.ts
T

8 lines
226 B
TypeScript

import { TextEncoder, TextDecoder } from "web-encoding"
export const encode = (text:string):Uint8Array =>
new TextEncoder().encode(text)
export const decode = (bytes:Uint8Array):string =>
new TextDecoder().decode(bytes)