UNPKG

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