UNPKG

@tetcoin/util

Version:
14 lines (13 loc) 390 B
/** * @name compactAddLength * @description Adds a length prefix to the input value * @example * <BR> * * ```javascript * import { compactAddLength } from '@tetcoin/util'; * * console.log(compactAddLength(new Uint8Array([0xde, 0xad, 0xbe, 0xef]))); // Uint8Array([4 << 2, 0xde, 0xad, 0xbe, 0xef]) * ``` */ export default function compactAddLength(input: Uint8Array): Uint8Array;