Files
pezkuwi-common/packages/util/u8a/cmp.d.ts
T

18 lines
572 B
TypeScript

/**
* @name u8aCmp
* @summary Compares two Uint8Arrays for sorting.
* @description
* For `UInt8Array` (or hex string) input values returning -1, 0 or +1
* @example
* <BR>
*
* ```javascript
* import { u8aCmp } from '@pezkuwi/util';
*
* u8aCmp(new Uint8Array([0x67, 0x65]), new Uint8Array([0x68, 0x65])); // -1
* u8aCmp(new Uint8Array([0x68, 0x65]), new Uint8Array([0x68, 0x65])); // 0
* u8aCmp(new Uint8Array([0x69, 0x65]), new Uint8Array([0x68, 0x65])); // +1
* ```
*/
export declare function u8aCmp(a: string | Uint8Array, b: string | Uint8Array): number;