Module: crypto/random

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

Source:

Methods

(async, static) getRandomBigInteger(min, max) → {Promise.<module:BigInteger>}

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

Parameters:
Name Type Description
min module:BigInteger

Lower bound, included

max module:BigInteger

Upper bound, excluded

Source:
Returns:

Random BigInteger.

Type
Promise.<module:BigInteger>

(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