davidbau / seedrandom

seeded random number generator for Javascript
2.06k stars 160 forks source link

Additional work on JavaScript randomness #23

Closed jeffrose closed 9 years ago

jeffrose commented 9 years ago

Have you looked at the work of Johannes Baagøe? Unfortunately his site went down a while ago, but someone made a copy of it on GitHub.

https://github.com/nquinlan/better-random-numbers-for-javascript-mirror

It has some analysis as well as JavaScript PRNG implementations.

davidbau commented 9 years ago

Thanks for the pointer. This is pretty interesting.

jeffrose commented 9 years ago

It might be worth it to add Alea (and others) to seedrandom.

davidbau commented 9 years ago

The standout was the Alea algorithm, which is impressively simple and fast. The PR has a direct port of Baagoe's code. It produces the same sequence for the same seeds as Baagoe's original.