678 B
678 B
Functions
compactAddLength
▸ compactAddLength(input: Uint8Array): Uint8Array
Defined in compact/addLength.ts:20
name: compactAddLength
description: Adds a length prefix to the input value
example:
import { compactAddLength } from '@polkadot/util';
console.log(compactAddLength(new Uint8Array([0xde, 0xad, 0xbe, 0xef]))); // Uint8Array([4 << 2, 0xde, 0xad, 0xbe, 0xef])
Parameters:
| Name | Type |
|---|---|
| input | Uint8Array |
Returns: Uint8Array