Interface

Modulus

Modulus

Members

number

# readonly bitCount

The significant bit count of the value of the current Modulus.

View Source modulus.ts, line 90

boolean

# readonly isPrime

Whether the value of the current Modulus is a prime number.

View Source modulus.ts, line 110

boolean

# readonly isZero

Whether the value of the current Modulus is zero.

View Source modulus.ts, line 100

BigInt

# readonly value

The value of the current Modulus as a BigInt.

View Source modulus.ts, line 79

Methods

# delete()

Delete the underlying WASM instance. Should be called before dereferencing this object to prevent the WASM heap from growing indefinitely.

View Source modulus.ts, line 50

# load(encoded)

Load a Modulus from a base64 string
Parameters:
Name Type Description
encoded string Base64 encoded string

View Source modulus.ts, line 148

# loadArray(array)

Load a Modulus from an Uint8Array holding binary data
Parameters:
Name Type Description
array Uint8Array TypedArray containing binary data

View Source modulus.ts, line 163

# save(compressionopt) → {string}

Save the Modulus as a base64 string
Parameters:
Name Type Attributes Default Description
compression ComprModeType <optional>
ComprModeType.zstd The compression mode to use

View Source modulus.ts, line 120

Base64 encoded string
string

# saveArray(compressionopt) → {Uint8Array}

Save the Modulus as a binary Uint8Array
Parameters:
Name Type Attributes Default Description
compression ComprModeType <optional>
ComprModeType.zstd The compression mode to use

View Source modulus.ts, line 131

A byte array containing the Modulus in binary form
Uint8Array

# setValue(value)

Loads a Modulus from a string representing an uint64 value.
Parameters:
Name Type Description
value BigInt BigInt value to set

View Source modulus.ts, line 64