NativeMathEngine
Defined in: src/engine/native.ts:12
Math.random behind the engine interface. The singleton
nativeMath is the only instance you need.
Example
Section titled “Example”nativeMath instanceof NativeMathEngine; // trueImplements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new NativeMathEngine():
NativeMathEngine
Returns
Section titled “Returns”NativeMathEngine
Properties
Section titled “Properties”algorithm
Section titled “algorithm”
readonlyalgorithm:"native-math"="native-math"
Defined in: src/engine/native.ts:13
Identifies the algorithm in EngineState.
Implementation of
Section titled “Implementation of”seedable
Section titled “seedable”
readonlyseedable:false=false
Defined in: src/engine/native.ts:14
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/native.ts:41
Stateless: every copy behaves identically.
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”fillBytes()
Section titled “fillBytes()”fillBytes(
out):void
Defined in: src/engine/native.ts:29
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/native.ts:24
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/native.ts:20
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/native.ts:16
A uniform integer in [0, 2^32).
Returns
Section titled “Returns”number