toBytes

Converts a value to an array of bytes.

Example

import { toBytes } from "thirdweb/utils";
const bytes = toBytes("0x1a4");
console.log(bytes); // Uint8Array(2) [ 1, 164 ]

Parameters

Returns

The array of bytes representing the value.