Converts a Uint8Array to the specified type.
import { fromBytes } from "thirdweb/utils";const bytes = new Uint8Array([1, 164]);const number = fromBytes(bytes, "number");console.log(number); // 420
function fromBytes< TTo extends "string" | "number" | "bigint" | "boolean" | "hex",>( bytes: Uint8Array, toOrOpts: FromBytesParameters<TTo>,): FromBytesReturnType<TTo>;
The Uint8Array to convert.
let bytes: Uint8Array;
The target type or conversion options.
let toOrOpts: FromBytesParameters<TTo>;
let returnType: FromBytesReturnType<TTo>;
The converted value of the specified type.