# best-random

> A replacement for Math.random() that is tiny, fast, seedable, and has good statistical properties.

Latest version **1.0.3** (published 2020-05-21) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2020-05-21 |
| First published | 2020-02-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Daniel Lehenbauer |
| Maintainers | dlehenbauer |
| Keywords | random, prng, rng, seedable, seed |

## Links

- npm: https://www.npmjs.com/package/best-random
- Repository: https://github.com/DLehenbauer/best-random
- Homepage: https://github.com/DLehenbauer/best-random#readme
- Issues: https://github.com/DLehenbauer/best-random/issues
- npm.io page: https://npm.io/package/best-random

## Recent versions

- 1.0.3 (latest) — 2020-05-21
- 1.0.0 — 2020-02-23

## README

# best-random
A humble replacement for `Math.random()` that is tiny, fast, seedable, and has good statistical properties.

## Overview
* Suitable for non-cryptographic applications
* Passes most statistical tests
* Period of ~2<sup>128</sup>
* ~600 bytes
* *Very* fast
 
## Installation
```
npm i best-random --save
```

## Usage
```js
const { Random } = require("best-random");

const rnd = new Random(/* seed: */ 42);     // New PRNG w/seed 42

console.log(rnd.float64());                 // Always prints '0.60829943369486'
console.log(rnd.uint32());                  // Always prints '803767485'
console.log(rnd.uint53());                  // Always prints '6835035088404228'
```

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