🔢 Decodes a hexadecimal string to bytes.
Syntax
TypeScript
import { bytesToString, decodeHex } from '@opentf/std'; decodeHex(str: string): Uint8Array
Parameters
str: The hexadecimal string to decode.
Returns
The decoded bytes.
Examples
TypeScript
decodeHex('48656c6c6f') //=> Uint8Array [72, 101, 108, 108, 111]