1 2 3 4 5 6 7 8 9
use rand::{self, Rng}; #[must_use] pub fn random_vec(len: usize) -> Vec<u8> { rand::thread_rng() .sample_iter(&rand::distributions::Standard) .take(len) .collect() }