Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/polkadot/util/mod.ts>compactToU8a

Package publishing for deno.land/x/polkadot
Go to Latest
function compactToU8a
import { compactToU8a } from "https://deno.land/x/polkadot@0.2.11/util/mod.ts";

Examples

import { compactToU8a } from 'https://deno.land/x/polkadot@0.2.11/util/mod.ts';

console.log(compactToU8a(511, 32)); // Uint8Array([0b11111101, 0b00000111])

Parameters

value: BN | bigint | number

Returns

Uint8Array