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

x/polkadot/util/mod.ts>hexToU8a

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

Examples

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

hexToU8a('0x80001f'); // Uint8Array([0x80, 0x00, 0x1f])
hexToU8a('0x80001f', 32); // Uint8Array([0x00, 0x80, 0x00, 0x1f])

Parameters

optional
value: HexString | string | null
optional
bitLength = [UNSUPPORTED]

Returns

Uint8Array