Skip to main content
Module

x/polkadot/mod.ts>util.compactFromU8a

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

Examples

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

const [offset, length] = compactFromU8a(new Uint8Array([254, 255, 3, 0]));

console.log('value offset=', offset, 'length=', length); // 4, 0xffff

Parameters

input: U8aLike

Returns

[number, BN]