Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 19x 19x 19x 207474x 101042x | import { Encoding } from "../types"; const encoder = /*@__PURE__*/ new TextEncoder(); const decoder = /*@__PURE__*/ new TextDecoder(); export const utf8: Encoding<string> = { encode(ctx, data) { ctx.i += encoder.encodeInto(data, ctx.bytes.subarray(ctx.i)) .written as number; }, decode: (ctx, size) => decoder.decode(ctx.bytes.subarray(ctx.i, (ctx.i += size))) }; |