UNPKG

@fedify/fedify

Version:

An ActivityPub server framework

14 lines (13 loc) 426 B
const textDecoder = new TextDecoder(); export const decodeText = (bytes) => textDecoder.decode(bytes); const textEncoder = new TextEncoder(); export const encodeText = (text) => textEncoder.encode(text); export function concat(arrs, length) { const output = new Uint8Array(length); let offset = 0; for (const arr of arrs) { output.set(arr, offset); offset += arr.length; } return output; }