Expand description
Pseudorandomness facilities.
This library mainly provides the RandomGen trait for (pseudo-)random
number generators, the Random trait for values that can be randomly
generated, and the BuildRandom generating representing relationships
between distributions and their generated types.
Of course, instances of these traits for common types from the standard
library are provided.
Additionally, it also provides the Pcg PRNG, which supports multiple
streams of randomness, has a long period, and is Quite Fast™ while having
fairly good statistical properties. While it is not cryptographically
secure, it is quite suited for purposes of e.g. generating levels or other
things.
Structs§
- Const
- Wrapper struct for the constant distribution.
- Iter
Build - An iterator over randomly built values.
- Iter
Choose From - An iterator over values randomly chosen from a slice.
- IterGen
- An iterator over randomly generated values.
- OsRng
RandomGenthat sources its randomness from the operating system.- Pcg
- A Permuted Congruential Generator.
Constants§
- HAS_
OS_ RNG trueiffOsRngsupports the targeted OS.
Traits§
- Build
Random - A type defining some distribution for generating (pseudo-)random values.
- Random
- A type that can be (pseudo-)randomly generated using a
RandomGen. - Random
Gen - A (pseudo-)random number generator.