Skip to content

Latest commit

 

History

History
110 lines (64 loc) · 1.74 KB

BigIntHelper.md

File metadata and controls

110 lines (64 loc) · 1.74 KB

Class: BigIntHelper

Helper methods for bigints.

Table of contents

Methods

Methods

read3

Static read3(data, byteOffset): BigInteger

Load 3 bytes from array as bigint.

Parameters

Name Type Description
data Uint8Array The input array.
byteOffset number The start index to read from.

Returns

BigInteger

The bigint.


read4

Static read4(data, byteOffset): BigInteger

Load 4 bytes from array as bigint.

Parameters

Name Type Description
data Uint8Array The input array.
byteOffset number The start index to read from.

Returns

BigInteger

The bigint.


read8

Static read8(data, byteOffset): BigInteger

Load 8 bytes from array as bigint.

Parameters

Name Type Description
data Uint8Array The data to read from.
byteOffset number The start index to read from.

Returns

BigInteger

The bigint.


write8

Static write8(value, data, byteOffset): void

Convert a big int to bytes.

Parameters

Name Type Description
value BigInteger The bigint.
data Uint8Array The buffer to write into.
byteOffset number The start index to write from.

Returns

void


random

Static random(): BigInteger

Generate a random bigint.

Returns

BigInteger

The bitint.