Module: crypto/random

Requires

Methods

(static) getRandomBigInteger(bits) → {BigInteger}

Create a secure random big integer of bits length
Parameters:
Name Type Description
bits Integer Bit length of the MPI to create
Source:
Returns:
Resulting big integer
Type
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

(static) getRandomValues(buf)

Helper routine which calls platform specific crypto random generator
Parameters:
Name Type Description
buf Uint8Array
Source:

(static) getSecureRandom(from, to) → {Integer}

Return a secure random number in the specified range
Parameters:
Name Type Description
from Integer Min of the random number
to Integer Max of the random number (max 32bit)
Source:
Returns:
A secure random number
Type
Integer

(inner) RandomBuffer()

Buffer for secure random numbers
Source: