mgold/elm-random-pcg/1.0.0

NOTE: this package is not compatible with Elm 0.19.1

Random.PCG for Elm

An alternate random number generator. You can import Random.PCG as Random and everything will continue to work (except elm-random-extra). This library offers two improvements over core, without a noticeable loss of performance.

  • Better statistical properties. If you use any seed less than 53668 and generate one bool, it will be True – if you're using the core library. This library produces far less predictable output, especially if you use thousands of random numbers. The core library fails after as little as five seconds of scrutiny. See test/dieharder for more details.

  • Splitability. Unlike core, this library exposes a split function to create two independent seeds from one. This allows for lazy lists and isolated components to generate as much randomness as they need, when they need it.

This is an implementation of PCG generators by M. E. O'Neil, based on the JS port by Thom Chiovoloni (MIT license). The generator is not cryptographically secure.