Just out of interest, what PRNG does Lua use?
PRNG in Math library
Jun 12 2019 01:23 PM
Interesting, I found a Lua implementation of Mersenne twister, unlike LCG has a very long period.
if you want a pure-lua mersenne twister, i might suggest this one instead, since it will pass validation - ie, using same seed, will generate an output sequence identical to the reference mt19937ar.out. (the one you linked offers no way to validate that it's a correct implementation, and a poor/flawed implementation of a good prng = a poor/flawed prng)
note that while mt is quite "good", it's ridiculously long period is not a significant factor of its overall "goodness". that is, if your primary need is a very long period then mt stands out, more than it would if your primary need were "indistinguishable from true randomness", for example.
the xoroshiro family are simpler and in many ways "gooder" than mt.