Skip to content

bytesCombine

bytesCombine(a, b, combine): Uint8Array<ArrayBuffer>

Defined in: packages/core/src/buffer/bytes-combine.ts:19

Applies combine to each octet pair of two equal-length arrays.

The result of combine is masked to one octet. Pairing stops at the shorter array only when lengths are allowed to differ, which they are not here: a bitwise operation over mismatched widths has no meaning, so it throws rather than silently truncating.

Complexity: O(n) time and O(n) memory in the input length.

Uint8Array

The left octets.

Uint8Array

The right octets.

(left, right, index) => number

Called with each octet pair and its index.

Uint8Array<ArrayBuffer>

A new array of the same length.

RangeError When the two arrays differ in length.