bytesToBigInt

Converts a Uint8Array of bytes to a bigint.

Example

import { bytesToBigInt } from "thirdweb/utils";
const bytes = new Uint8Array([1, 164]);
const bigInt = bytesToBigInt(bytes);
console.log(bigInt); // 420n
function bytesToBigInt(
bytes: Uint8Array<ArrayBufferLike>,
): bigint;

Parameters

The Uint8Array of bytes to convert.

Type

let bytes: Uint8Array<ArrayBufferLike>;

Optional parameters for the conversion.

Type

let opts: { signed?: boolean; size?: number };

Returns

let returnType: bigint;

The converted bigint.