hexToU8a
Creates a Uint8Array object from a hex string.
Hex input values return the actual bytes value converted to a string. Anything that is not a hex string (including the 0x prefix) throws an error.
0x
import { hexToString } from '@polkadot/util';hexToU8a('0x68656c6c6f'); // hello
Optional
Generated using TypeDoc
Name
hexToU8a
Summary
Creates a Uint8Array object from a hex string.
Description
Hex input values return the actual bytes value converted to a string. Anything that is not a hex string (including the
0x
prefix) throws an error.Example