Random number generation is a fundamental technology that we use daily—encryption, simulation, approximation, testing, data selection, and more. Each of these applications has its own requirements for the random number generator (https://xkcd.com/221/). While encryption needs a generator that is as close to true randomness (https://www.random.org/) as possible, simulation, testing, and data selection may need to have reproducible samples drawn from a certain distribution.
Due to printing constraints we had to replace the original emoji with characters and numbers. Check out the GitHub repository for this book for the full version.
Since there is no random generator in Rust's standard library, the rand crate is the way to go for many projects. Let's see how we can use it.