Module: crypto/random

Provides tools for retrieving secure randomness from browsers or Node.js

Source:

Requires

Methods

(async, static) getRandomBN(min, max) → {module:BN}

Create a secure random MPI that is greater than or equal to min and less than max.

Parameters:
Name Type Description
min module:type/mpi

Lower bound, included

max module:type/mpi

Upper bound, excluded

Source:
Returns:

Random MPI

Type
module:BN

(async, static) getRandomBytes(length) → {Uint8Array}

Retrieve secure random byte array of the specified length

Parameters:
Name Type Description
length Integer

Length in bytes to generate

Source:
Returns:

Random byte array

Type
Uint8Array

(inner) RandomBuffer()

Buffer for secure random numbers

Source: