splitmix64.js

Posted at

http://prng.di.unimi.it/splitmix64.c seamlessly translated into a workable JavaScript code using BigInt ecma262 - sec-bigint-objects.

BigInt is a built-in object that provides a way to represent whole numbers larger than 253-1, which is the largest number JavaScript can reliably represent with the Number primitive. BigInt can be used for arbitrarily large integers.



splitmix64.c.js is used to initialize the state of the random-number generators from http://prng.di.unimi.it/, starting from a 64-bit seed, as research has shown that initialization must be performed with a generator radically different in nature from the one initialized to avoid correlation on similar seeds.

https://gist.github.com/eladkarako/bf3f8a6017bba9b69185e6e7b4757513#file-splitmix64-js




as for BigInt polyfill, (which may require a code-modification),
see https://github.com/peterolson/BigInteger.js and its wrapper https://github.com/graup/bigint-polyfill or Google's: https://github.com/GoogleChromeLabs/jsbi/blob/master/README.md.