Helper methods for bigints.
▸ Static
read3(data
, byteOffset
): BigInteger
Load 3 bytes from array as bigint.
Name | Type | Description |
---|---|---|
data |
Uint8Array |
The input array. |
byteOffset |
number |
The start index to read from. |
BigInteger
The bigint.
▸ Static
read4(data
, byteOffset
): BigInteger
Load 4 bytes from array as bigint.
Name | Type | Description |
---|---|---|
data |
Uint8Array |
The input array. |
byteOffset |
number |
The start index to read from. |
BigInteger
The bigint.
▸ Static
read8(data
, byteOffset
): BigInteger
Load 8 bytes from array as bigint.
Name | Type | Description |
---|---|---|
data |
Uint8Array |
The data to read from. |
byteOffset |
number |
The start index to read from. |
BigInteger
The bigint.
▸ Static
write8(value
, data
, byteOffset
): void
Convert a big int to bytes.
Name | Type | Description |
---|---|---|
value |
BigInteger |
The bigint. |
data |
Uint8Array |
The buffer to write into. |
byteOffset |
number |
The start index to write from. |
void
▸ Static
random(): BigInteger
Generate a random bigint.
BigInteger
The bitint.