Cover Image
1 / 1
←
→
Random-seedable is an open-source collection of random number generators written in JavaScript with built-in support for Typescript. I built it up over a number of weeks while trying to gather a greater understanding of modern seedable random number generators. Its current audience is developers writing games, generative artists, and is now used as part of Microsofts' FluentUI.
What I Did
- Implemented both 32 and 64 bit versions of many popular and frequently used random number generators (LCG, PCG, XorShift etc.) in both C++ and JavaScript. It is one of the few JS libraries which contain 'true' 64-bit generators as each uses the newly introduced BigInt class to perform its generation functions.
- Full API covering the most common functions expected of a random number generator(shuffle, randRange, choice, coin.)
- Full suite of tests based on reference data from C++ versions which are themselves based on original code, ensuring that all implementations are correct.