Macro vrd::rand_string
source · macro_rules! rand_string { ($rng:expr, $length:expr) => { ... }; }
Expand description
Generates a random string of the specified length.
The generated string can contain lowercase letters (a-z), uppercase letters (A-Z), and digits (0-9).
§Examples
use vrd::rand_string;
let mut rng = vrd::random::Random::new();
let random_string = rand_string!(rng, 10);
println!("Random string: {}", random_string);
§Arguments
rng
- A mutable reference to aRandom
instance.length
- The desired length of the random string.
§Returns
A randomly generated string of the specified length.