812 B
812 B
Functions
compactToU8a
▸ compactToU8a(_value: * BN | number*, bitLength?: BitLength): Uint8Array
Defined in compact/toU8a.ts:29
name: compactToU8a
description: Encodes a number into a compact representation
example:
import { compactToU8a } from '@polkadot/util';
console.log(compactToU8a(511, 32)); // Uint8Array([0b11111101, 0b00000111])
Parameters:
| Name | Type | Default value |
|---|---|---|
| _value | BN | number |
- |
Default value bitLength |
BitLength | DEFAULT_BITLENGTH |
Returns: Uint8Array