Docs

hexToUint8Array

Converts a hexadecimal string to a Uint8Array.

Example

import { hexToUint8Array } from "thirdweb/utils";
const bytes = hexToUint8Array("0x48656c6c6f2c20776f726c6421");
console.log(bytes); // Uint8Array([72, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100, 33])

Parameters

Returns

The Uint8Array representation of the hexadecimal string.