Crate randomize [−] [src]
A dead simple to use randomization library for rust.
Functions exist to use a lazily-initialized, mutex-guarded, global generator. As you can guess, this is slower than necessary, so you can also make your own generator and call methods on that. The exact nature of the global generator is deliberately unspecified so that it can be improved or replaced in future versions if necessary.
This library gives priority to ease of use rather than trying to cover all possible uses. If you want a totally comprehensive randomization library for all possible cases then this really isn't for you.
NOT FOR CRYPTOGRAPHIC PURPOSES.
Structs
PCG32 |
A permuted congruential generator with 32-bits of output per step. |
Traits
AnyRandom |
A trait for types can can be generated in "any" state. |
Functions
any |
Gives a random value of the desired type from the global RNG. |
any_ascii |
Gives an ASCII value from the global RNG. |
any_f32_zero_to_one |
An |
in_range |
Returns a value out of the |
next_u32 |
Returns a |
percent_chance |
Returns |