diff options
Diffstat (limited to 'vendor/fastrand/README.md')
-rw-r--r-- | vendor/fastrand/README.md | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/vendor/fastrand/README.md b/vendor/fastrand/README.md index 0da0612ea..70da00bc6 100644 --- a/vendor/fastrand/README.md +++ b/vendor/fastrand/README.md @@ -40,6 +40,13 @@ let i = fastrand::usize(..v.len()); let elem = v[i]; ``` +Sample values from an array with `O(n)` complexity (`n` is the length of array): + +```rust +fastrand::choose_multiple(vec![1, 4, 5].iter(), 2); +fastrand::choose_multiple(0..20, 12); +``` + Shuffle an array: ```rust @@ -76,6 +83,12 @@ let rng = fastrand::Rng::new(); let mut bytes: Vec<u8> = repeat_with(|| rng.u8(..)).take(10_000).collect(); ``` +# Features + +- `std` (enabled by default): Enables the `std` library. This is required for the global + generator and global entropy. Without this feature, [`Rng`] can only be instantiated using + the [`with_seed`](Rng::with_seed) method. + ## License Licensed under either of |