Crates.io | shuf-rs |
lib.rs | shuf-rs |
version | 0.2.0 |
source | src |
created_at | 2021-07-07 18:33:10.083113 |
updated_at | 2024-07-19 18:17:20.309242 |
description | Generate random permutations of an iterable with reservior sampling |
homepage | https://github.com/gmodena/shuf-rs/ |
repository | https://github.com/gmodena/shuf-rs/ |
max_upload_size | |
id | 419978 |
size | 17,330 |
Shuffle lines of text with reservior sampling.
cargo build --release
The resulting binary is found under target/release/shuf
.
USAGE:
shuf [OPTIONS] [path]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-n, --head-count=COUNT <num> Number of lines to read
ARGS:
<path> The path to the file to read
src/shuf.rs
contains a reusable implementation of reservior sampling, that works on any iterable.