API reference@evolu/common › Random

Seeded random number generation.

Functions

FunctionDescription
createRandomCreates a Random using Math.random().
createRandomLibCreates a RandomLib using the NPM random package.
createRandomWithSeedCreates Random using RandomLibDep with a seed which is useful for tests.
testCreateRandomCreates a seeded Random for deterministic tests. Default seed "evolu".
testCreateRandomLibCreates a seeded RandomLib for deterministic tests. Default seed "evolu".

Interfaces

InterfaceDescription
RandomA simple wrapper around Math.random().
RandomDep-
RandomLibDepA random number generator using the NPM random package dependency.

Type Aliases

Type AliasDescription
RandomNumberA random floating point number in [0, 1).