3 ms·
For a RNG, the maximum run length of same values would be the period length divided by the output size (in general). The blog post is horrifying, it feeds the
by ryacko 7y ago
For a RNG, the maximum run length of same values would be the period length divided by the output size (in general).
The blog post is horrifying, it feeds the output of the Mersenne Twister into another function to reduce the run length of seemingly biased outcomes. I think to generate a single value the whole CPU’s cache is cleared from the size and complexity of the code. The AES S-box, with the seed XORed before and after, would still be a better solution (especially since the probably of certain runs of similar values should be somewhat low).
The theory behind LCGs is a lot simpler, and using a suitably small prime, I think, one could have an appropriately short period without excessive predictability.