# seedable-random

> Seedable Math.random compatible pseudorandom number generator

Latest version **0.0.1** (published 2013-10-13) · BSD license · 0 weekly downloads

## Install

```sh
npm install seedable-random
pnpm add seedable-random
yarn add seedable-random
bun add seedable-random
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2013-10-13 |
| First published | 2013-10-13 |
| Weekly downloads | 0 |
| License | BSD |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Antti Sykäri |
| Maintainers | anttisykari |
| Keywords | seedable, random, prng |

## Links

- npm: https://www.npmjs.com/package/seedable-random
- npm.io page: https://npm.io/package/seedable-random

## Recent versions

- 0.0.1 (latest) — 2013-10-13

## README

# Seedable pseudorandom number generator

## Usage

	var random = require('seedable-random');

	random.seed(123);
	console.log(random());

## As a `Math.random` replacement

	Math.random = require('seedable-random');
	Math.random.seed(12345);

- Works as a drop-in for `Math.random`

- Relatively fast (about 2.5 times slower than `Math.random` on my machine)

- Seeds itself from the clock by default

- Tries to be pretty random

- Well tested (TODO come up with some PRNG torture tests)

## TODO

Possibility to switch the generator (linear-feedback shift register, Mersenne
twister, digits of Math.sin(), etc. based on your needs)

## A word of warning

Current implementation just calls Math.sin() with the seed.  It's likely that
it's not quite that random (for example, the distribution could be biased
towards numbers near 1.0).  Some more tests are needed.

---
_Source: https://npm.io/package/seedable-random · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
