/**
 * To guarantee Uint8Array semantics, convert nodejs Buffers
 * into vanilla Uint8Arrays
 */
export function asUint8Array(buf) {
    if (buf.buffer instanceof ArrayBuffer) {
        return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);
    }
    const b = buf.slice();
    return new Uint8Array(b.buffer, 0, b.byteLength);
}
//# sourceMappingURL=as-uint8array.node.js.map