• Stars
    star
    113
  • Rank 310,115 (Top 7 %)
  • Language
    JavaScript
  • Created almost 11 years ago
  • Updated almost 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Mersenne Twister pseudorandom number generator

Pseudorandom number generator Build Status

Mersenne Twister pseudorandom number generator.

Origin source (generator interface was changed)

Algorithm - http://en.wikipedia.org/wiki/Mersenne_twister

Installation

$ npm install mersenne-twister

Usage

var MersenneTwister = require('mersenne-twister');
var generator = new MersenneTwister();

// Generates a random number on [0,1) real interval (same interval as Math.random)
generator.random();

// [0, 4294967295]
generator.random_int();

// [0,1]
generator.random_incl();

// (0,1)
generator.random_excl();

// [0,1) with 53-bit resolution
generator.random_long();

// [0, 2147483647]
generator.random_int31();

Seeding

If you want to use a specific seed in order to get a repeatable random sequence, pass an integer into the constructor:

var generator = new MersenneTwister(123);

and that will always produce the same random sequence.

Also you can do it on existing generator instance:

generator.init_seed(123);

License

See source

More Repositories

1

casual

Fake data generator for javascript
JavaScript
3,008
star
2

shitty-qs

Shitty query strings parser
JavaScript
17
star
3

express-delay

Delay express responses
JavaScript
17
star
4

node-amocrm-api

AmoCRM api client for nodejs
JavaScript
16
star
5

realist

Micro framework for developing command line apps
JavaScript
15
star
6

mgrt

Database migration tool for node.js
JavaScript
13
star
7

apiapi

Api client builder
JavaScript
10
star
8

knex-dal

Extendable knex-based data access layer builder
JavaScript
7
star
9

buffer-chunks

Split Buffer into a chunks
JavaScript
7
star
10

generator-yii

Yeoman generator for Yii apps
PHP
5
star
11

irm

Install Required Modules
JavaScript
4
star
12

app-log

JSON logger
JavaScript
4
star
13

cnfg

Hierarchical environment configuration for node.js applications
JavaScript
4
star
14

molyjamdn

Moly Jam project
CoffeeScript
4
star
15

activity-manager

Yii2 application dedicated to manage your (sport) activity.
PHP
4
star
16

network

Academy Project
PHP
4
star
17

yartf

Yet Another Rest Test Framework
JavaScript
3
star
18

yandex-speller

Wrapper for Yandex Speller API http://api.yandex.ru/speller/
PHP
3
star
19

kusd

Decode kubernetes secrets
JavaScript
3
star
20

planfix-api

API client for planfix.ru
JavaScript
3
star
21

all-requires

Get list of all required modules recursively
JavaScript
2
star
22

app-deploy

Deploy app in one line
JavaScript
2
star
23

docker-strider

Dockerfiles for stridercd
Shell
2
star
24

shared

Shared storage using native shm functions
PHP
2
star
25

cate

Pretty printer for different file formats
JavaScript
2
star
26

servermy

C
1
star
27

yelp-api-php

PHP wrapper for yelp business API v2
PHP
1
star
28

electron-chartjs

Render chart.js charts using electron
JavaScript
1
star
29

dotfiles

vimrc, colorscheme, xmonad config, bashrc and stuff
Vim Script
1
star
30

php-json-rpc

Example of PHP JSON-RPC server application + backbone-based debug client
PHP
1
star
31

nearest-file

Find nearest file in path
JavaScript
1
star
32

express-decrypt

Express middleware for request body decrypting
JavaScript
1
star
33

great-reaper

Web scrapper for the win
JavaScript
1
star
34

clickhouze

Naive clickhouse client wrapper
JavaScript
1
star
35

pflow

Compose promised functions into flow
JavaScript
1
star
36

bank-gov-ua-currency-convert

Convert currencies based on https://bank.gov.ua/control/uk/publish/article?art_id=38441973
JavaScript
1
star
37

NordCms

Mirror of https://bitbucket.org/NordLabs/nordcms
PHP
1
star
38

check-site-for

Check given list of sites for given content
JavaScript
1
star
39

citygrid-php

Wrapper for CityGrid API
PHP
1
star
40

yii-bootstrap

Mirror of https://bitbucket.org/Crisu83/yii-bootstrap
PHP
1
star
41

semaphore

Don't let your app be afraid of parallel execution
PHP
1
star