[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › Random

Random number generation.

## Functions

| Function                                                                                   | Description                                                                                                 |
| ------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------- |
| [createRandom](https://evolu.dev/docs/api-reference/common/Random/functions/createRandom)               | Creates a [Random](https://evolu.dev/docs/api-reference/common/Random/interfaces/Random) using Math.random().            |
| [createRandomLib](https://evolu.dev/docs/api-reference/common/Random/functions/createRandomLib)         | Creates a random number generator from the NPM `random` package.                                            |
| [testCreateRandom](https://evolu.dev/docs/api-reference/common/Random/functions/testCreateRandom)       | Creates a seeded [Random](https://evolu.dev/docs/api-reference/common/Random/interfaces/Random) for deterministic tests. |
| [testCreateRandomLib](https://evolu.dev/docs/api-reference/common/Random/functions/testCreateRandomLib) | Creates a seeded random number generator from the NPM `random` package for deterministic tests.             |

## Interfaces

| Interface                                                                     | Description                                                                                                  |
| ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| [Random](https://evolu.dev/docs/api-reference/common/Random/interfaces/Random)             | A simple wrapper around Math.random().                                                                       |
| [RandomDep](https://evolu.dev/docs/api-reference/common/Random/interfaces/RandomDep)       | -                                                                                                            |
| [RandomLibDep](https://evolu.dev/docs/api-reference/common/Random/interfaces/RandomLibDep) | Seedable random number generator supporting many common distributions, provided by the NPM `random` package. |

## Type Aliases

| Type Alias                                                                      | Description                               |
| ------------------------------------------------------------------------------- | ----------------------------------------- |
| [RandomNumber](https://evolu.dev/docs/api-reference/common/Random/type-aliases/RandomNumber) | A random floating point number in [0, 1). |