UNPKG

uint8arrays

Version:

Utility functions to make dealing with Uint8Arrays easier

10 lines (8 loc) 305 B
import { Buffer } from 'node:buffer' import { asUint8Array } from '#util/as-uint8array' /** * Returns a new Uint8Array created by concatenating the passed Uint8Arrays */ export function concat (arrays: Uint8Array[], length?: number): Uint8Array { return asUint8Array(Buffer.concat(arrays, length)) }