Hex.toBytes
Decodes a Hex.Hex
value into a Bytes.Bytes
.
Imports
Named
import { Hex } from 'ox'
Examples
import { Hex } from 'ox'
const data = Hex.toBytes('0x48656c6c6f20776f726c6421')
Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33])
Definition
function toBytes(
hex: Hex,
options?: toBytes.Options,
): Bytes.Bytes
Source: src/Hex.ts
Parameters
hex
- Type:
Hex
The Hex.Hex
value to decode.
options
- Type:
toBytes.Options
- Optional
Options.
options.size
- Type:
number
- Optional
Size (in bytes) of the hex value.
Return Type
The decoded Bytes.Bytes
.
Bytes.Bytes
Error Type
Hex.toBytes.ErrorType