Skip to content

compareBytes

compareBytes(a, b): number

Defined in: packages/core/src/buffer/compare-bytes.ts:10

Compares two Uint8Arrays lexicographically by byte value.

Uint8Array

The first array to compare.

Uint8Array

The second array to compare.

number

A negative number if a sorts before b, positive if after, zero if equal. When one array is a prefix of the other, the shorter one sorts first.