UNPKG

420 BTypeScriptView Raw
1/// <reference types="bn.js" />
2import { BN } from '../bn/index.js';
3/**
4 * @name compactToU8a
5 * @description Encodes a number into a compact representation
6 * @example
7 * <BR>
8 *
9 * ```javascript
10 * import { compactToU8a } from '@polkadot/util';
11 *
12 * console.log(compactToU8a(511, 32)); // Uint8Array([0b11111101, 0b00000111])
13 * ```
14 */
15export declare function compactToU8a(value: BN | bigint | number): Uint8Array;