UNPKG

573 BTypeScriptView Raw
1/**
2 * @name u8aCmp
3 * @summary Compares two Uint8Arrays for sorting.
4 * @description
5 * For `UInt8Array` (or hex string) input values returning -1, 0 or +1
6 * @example
7 * <BR>
8 *
9 * ```javascript
10 * import { u8aCmp } from '@polkadot/util';
11 *
12 * u8aCmp(new Uint8Array([0x67, 0x65]), new Uint8Array([0x68, 0x65])); // -1
13 * u8aCmp(new Uint8Array([0x68, 0x65]), new Uint8Array([0x68, 0x65])); // 0
14 * u8aCmp(new Uint8Array([0x69, 0x65]), new Uint8Array([0x68, 0x65])); // +1
15 * ```
16 */
17export declare function u8aCmp(a: string | Uint8Array, b: string | Uint8Array): number;