UNPKG

494 BTypeScriptView Raw
1/**
2 * @name compactStripLength
3 * @description Removes the length prefix, returning both the total length (including the value + compact encoding) and the decoded value with the correct length
4 * @example
5 * <BR>
6 *
7 * ```javascript
8 * import { compactStripLength } from '@polkadot/util';
9 *
10 * console.log(compactStripLength(new Uint8Array([2 << 2, 0xde, 0xad]))); // [2, Uint8Array[0xde, 0xad]]
11 * ```
12 */
13export declare function compactStripLength(input: Uint8Array): [number, Uint8Array];