Converts a bigint number into a 256-bit big-endian (U256BE) representation as a Uint8Array.
bigint
U256BE
Uint8Array
The bigint number to be converted to a 256-bit big-endian format.
A Uint8Array representing the 256-bit big-endian encoded value.
If the number is out of range for a 256-bit unsigned integer.
const bigIntValue = BigInt('123456789012345678901234567890');const u256Bytes = toU256BE(bigIntValue);console.log(u256Bytes); Copy
const bigIntValue = BigInt('123456789012345678901234567890');const u256Bytes = toU256BE(bigIntValue);console.log(u256Bytes);
Converts a
bigint
number into a 256-bit big-endian (U256BE
) representation as aUint8Array
.