API reference › @evolu/common › Random
Seeded random number generation.
Functions
| Function | Description |
|---|---|
| createRandom | Creates a Random using Math.random(). |
| createRandomLib | Creates a RandomLib using the NPM random package. |
| createRandomWithSeed | Creates Random using RandomLibDep with a seed which is useful for tests. |
| testCreateRandom | Creates a seeded Random for deterministic tests. Default seed "evolu". |
| testCreateRandomLib | Creates a seeded RandomLib for deterministic tests. Default seed "evolu". |
Interfaces
| Interface | Description |
|---|---|
| Random | A simple wrapper around Math.random(). |
| RandomDep | - |
| RandomLibDep | A random number generator using the NPM random package dependency. |
Type Aliases
| Type Alias | Description |
|---|---|
| RandomNumber | A random floating point number in [0, 1). |