UNPKG

@fanoutio/grip

Version:
10 lines (9 loc) 309 B
export function concatUint8Arrays(...arrays) { const combinedBuffer = new Uint8Array(arrays.reduce((acc, seg) => acc + seg.length, 0)); let offset = 0; for (const item of arrays) { combinedBuffer.set(item, offset); offset = offset + item.length; } return combinedBuffer; }