@tetcoin/util
Version:
A collection of useful utilities for @tetcoin
15 lines (14 loc) • 366 B
TypeScript
import BN from 'bn.js';
/**
* @name compactToU8a
* @description Encodes a number into a compact representation
* @example
* <BR>
*
* ```javascript
* import { compactToU8a } from '@tetcoin/util';
*
* console.log(compactToU8a(511, 32)); // Uint8Array([0b11111101, 0b00000111])
* ```
*/
export default function compactToU8a(_value: BN | number): Uint8Array;