# fn-mt

> functional implementation of Mersenne Twister

Latest version **1.2.1** (published 2020-03-09) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install fn-mt
pnpm add fn-mt
yarn add fn-mt
bun add fn-mt
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2020-03-09 |
| First published | 2020-03-03 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Akihito KIRISAKI |
| Maintainers | a_kirisaki |

## Links

- npm: https://www.npmjs.com/package/fn-mt
- Repository: https://github.com/kirisaki/fn-mt
- Homepage: https://github.com/kirisaki/fn-mt#readme
- Issues: https://github.com/kirisaki/fn-mt/issues
- npm.io page: https://npm.io/package/fn-mt

## Recent versions

- 1.2.1 (latest) — 2020-03-09
- 1.2.0 — 2020-03-05
- 1.0.3 — 2020-03-04
- 1.0.1 — 2020-03-04
- 1.0.0 — 2020-03-03

## README

# fn-mt
Functional implementation of Mersenne Twister

## Usage

```typescript
import { newRandGen, randNext, randRange } from 'fn-mt'

const gen = newRandGen(42)

const [n1, gen1] = randNext(gen)
const [n2, gen2] = randNext(gen1)
const [n3, gen3] = randNext(gen2)

console.log(n1)
console.log(n2)
console.log(n3)

// same generator generate same number
const [n4, gen4] = randNext(gen2)

console.log(n4)

// ranged int
const [n5, gen5] = randRange(0, 6, gen4)

console.log(n5) // generate integer from 0 to 5
```

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