UNPKG

uint8arrays

Version:

Utility functions to make dealing with Uint8Arrays easier

8 lines (7 loc) 228 B
/** * To guarantee Uint8Array semantics, convert nodejs Buffers * into vanilla Uint8Arrays */ export function asUint8Array (buf: Uint8Array): Uint8Array { return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength) }