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

x/polkadot/util/hex/index.ts>hexToU8a

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

Examples

import { hexToU8a } from 'https://deno.land/x/polkadot@0.2.17/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