rust_wheel 0.1.12

A project to define some public component.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use rand::distributions::Alphanumeric;
use rand::{thread_rng, Rng};

pub fn generate_random_string(length: usize) -> String {
    let rng = thread_rng();
    let random_string: String = rng
        .sample_iter(&Alphanumeric)
        .take(length)
        .map(char::from)
        .collect();
    random_string
}