It is high time we let go of the Mersenne Twister (2019)
As just a datapoint from some random person, I needed a pseudo-random number generator just last week.<p>My use-case is semi-embedded, with two applications running on different hardware and operating systems, that both needed to generate streams of <i>the same</i> random data. I first naively went with just rand() to get it running, but obviously there&#x27;s no guerantee that two completely different platforms&#x27; C libraries have the same PRNGs. So that didn&#x27;t  work.<p>Like many (?), the Mersenne Twister is the first name that pops into my head if I think of &quot;known&quot; PRNG implementations, so I investigated it. I quickly came to the conclusion that it was kind of large in terms of amount of code and state for many applications, so I kept looking.<p>Eventually I went with xorshift32 [1] and am very happy with that choice. The core of the implementation is ~10 lines of C, and my entire module (header+implementation, with mild commenting and a faux-main() test &quot;driver&quot;) is sitting at 60 lines. It needs a whopping 32 bits of state, which I could manage to squeeze in just fine. :)<p>[1]: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Xorshift" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Xorshift</a>