kindness
Methods for choosing random elements from an iterator.
Includes choose_item(), choose_max(), choose_max_by(), choose_max_by_key(), choose_min(), choose_min_by(), choose_min_by_key()
Does not allocate or iterate iterators more than once. Uses every bit of randomness generated as efficiently as possible, making an average of 16 comparisons per u32.
The choose_item() method is currently about twice as fast as the choose() method in the rand crate for iterators without a size hint.
If you are confused by the name of the crate, think "random max of".
This crate works with Cargo with a Cargo.toml like:
[]
= "0.3.0"
= "0.8.5"
Getting started
use *;
use SeedableRng;
Contributing
Contributions are welcome! Open a pull request to fix a bug, or open an issue to discuss a new feature or change.
Check out the Contributing section in the docs for more info.
License
This project is proudly licensed under the MIT license (LICENSE or http://opensource.org/licenses/MIT).
kindness can be distributed according to the MIT license. Contributions
will be accepted under the same license.