@tetcoin/util
Version:
A collection of useful utilities for @tetcoin
15 lines (14 loc) • 553 B
TypeScript
import { BitLength } from './types';
/**
* @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
* <BR>
*
* ```javascript
* import { compactStripLength } from '@tetcoin/util';
*
* console.log(compactStripLength(new Uint8Array([2 << 2, 0xde, 0xad]))); // [2, Uint8Array[0xde, 0xad]]
* ```
*/
export default function compactStripLength(input: Uint8Array, bitLength?: BitLength): [number, Uint8Array];