1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
Appellation: generate <module>
Creator: FL03 <jo3mccain@icloud.com>
Description:
... Summary ...
*/
pub use self::{alphabet::*, utils::*};

pub(crate) mod alphabet;

pub(crate) mod utils {
    use rand::{distributions::Alphanumeric, Rng};

    pub fn generate_random_string(len: usize) -> String {
        rand::thread_rng()
            .sample_iter(&Alphanumeric)
            .take(len)
            .map(char::from)
            .collect()
    }
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_generate_alpha_default() {
        assert_ne!(StringGenerator::default(), StringGenerator::default())
    }
}