API reference › @evolu/common › Type › hexToUint8Array
function hexToUint8Array(value: string & Brand<"Hex">): Uint8Array;
Defined in: packages/common/src/Type.ts:8980
Converts Hex to bytes.
Example
import { assertEqual, Hex, hexToUint8Array } from "@evolu/common";
const value = Hex.orThrow("000102ff");
assertEqual(hexToUint8Array(value), new Uint8Array([0, 1, 2, 255]));