CryptoEngine
Defined in: src/engine/crypto.ts:18
The platform CSPRNG behind the engine interface. The singleton cryptoRandom is the only instance you need.
Example
Section titled “Example”cryptoRandom instanceof CryptoEngine; // trueImplements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CryptoEngine():
CryptoEngine
Returns
Section titled “Returns”CryptoEngine
Properties
Section titled “Properties”algorithm
Section titled “algorithm”
readonlyalgorithm:"crypto"="crypto"
Defined in: src/engine/crypto.ts:19
Identifies the algorithm in EngineState.
Implementation of
Section titled “Implementation of”seedable
Section titled “seedable”
readonlyseedable:false=false
Defined in: src/engine/crypto.ts:20
Whether the engine can be re-seeded. Math.random and the CSPRNG cannot.
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”clone()
Section titled “clone()”clone():
Engine
Defined in: src/engine/crypto.ts:51
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”fillBytes()
Section titled “fillBytes()”fillBytes(
out):void
Defined in: src/engine/crypto.ts:47
Parameters
Section titled “Parameters”Uint8Array
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”fillUint32()
Section titled “fillUint32()”fillUint32(
out):void
Defined in: src/engine/crypto.ts:40
Parameters
Section titled “Parameters”Uint32Array
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”nextFloat64()
Section titled “nextFloat64()”nextFloat64():
number
Defined in: src/engine/crypto.ts:34
A uniform double in [0, 1) with 53 bits of precision.
Returns
Section titled “Returns”number
Implementation of
Section titled “Implementation of”nextUint32()
Section titled “nextUint32()”nextUint32():
number
Defined in: src/engine/crypto.ts:26
A uniform integer in [0, 2^32).
Returns
Section titled “Returns”number