UNPKG

415 BJavaScriptView Raw
1import { u8aCmp } from './cmp.js';
2/**
3 * @name u8aSorted
4 * @summary Sorts an array of Uint8Arrays
5 * @description
6 * For input `UInt8Array[]` return the sorted result
7 * @example
8 * <BR>
9 *
10 * ```javascript
11 * import { u8aSorted} from '@polkadot/util';
12 *
13 * u8aSorted([new Uint8Array([0x69]), new Uint8Array([0x68])]); // [0x68, 0x69]
14 * ```
15 */
16export function u8aSorted(u8as) {
17 return u8as.sort(u8aCmp);
18}