Skip to content

A C++ Mersenne Twister Random Number Generator exposed to Node.js

Notifications You must be signed in to change notification settings

sbehnke/mtrand-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mtrand-node

A C++ Mersenne Twister Random Number Generator exposed to Node.js

This is my first attempt at a Node.js add-on written in C++. I'm fairly certainly there's still a lot broken with it but it a pretty simple exercise for me to learn from. I took the C++ implementation of the Mersenne Twister implementation from Jasper Bedaux http://www.bedaux.net/mtrand/

Currently the random number is seeded when the module is loaded. It reads random data from /dev/urandom on OS X and uses CryptGenRandom on Win32. I have not yet tested it on other platforms, or put in code to explicitly allow for Win64 to use the same CryptGenRandom API call. I'll test it on my Ubuntu VM and 64-bit Windows Server 2012 soon.

About

A C++ Mersenne Twister Random Number Generator exposed to Node.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published