smol-rs / fastrand

A simple and fast random number generator
Apache License 2.0
409 stars 35 forks source link

Add choose_multiple #29

Closed DE0CH closed 1 year ago

DE0CH commented 2 years ago

The choose_multiple function chooses multiple elements from an iterable, using the reservoir sampling algorithm. It is useful for sampling numbers from a list and generating a list of random numbers with no repetition.

Adapted from: https://docs.rs/rand/latest/rand/seq/trait.IteratorRandom.html#method.choose_multiple.

notgull commented 1 year ago

This probably also needs to be rebased on the lastest changes.

notgull commented 1 year ago

@DE0CH Are you able to update this branch to the newest version? If not, I can take care of it

DE0CH commented 1 year ago

Sorry I am quite busy this week. If you could help me that would be great thanks.

notgull commented 1 year ago

Closed in #55