Functions
compactStripLength
▸ compactStripLength(input: Uint8Array, bitLength?: BitLength): [number, Uint8Array]
Defined in compact/stripLength.ts:22
name: compactStripLength
description: Removes the length prefix, returning both the total length (including the value + compact encoding) and the decoded value with the correct length
example:
import { compactStripLength } from '@polkadot/util';
console.log(compactStripLength(new Uint8Array([2 << 2, 0xde, 0xad]))); // [2, Uint8Array[0xde, 0xad]]
1
2
3
2
3
Parameters:
| Name | Type | Default value |
|---|---|---|
| input | Uint8Array | - |
Default value bitLength | BitLength | DEFAULT_BITLENGTH |
Returns: [number, Uint8Array]