numberToBytes

Converts a number to bytes.

Example

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

Parameters

Returns

The bytes representation of the number.