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

x/polkadot/util/mod.ts>hexFixLength

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

Examples

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

console.log('fixed', hexFixLength('0x12', 16)); // => 0x12
console.log('fixed', hexFixLength('0x12', 16, true)); // => 0x0012
console.log('fixed', hexFixLength('0x0012', 8)); // => 0x12

Parameters

value: string
optional
bitLength = [UNSUPPORTED]
optional
withPadding = [UNSUPPORTED]

Returns

HexString