crypt_tool

Function system_random

source
pub fn system_random() -> u32
Examples found in repository?
examples/example.rs (line 3)
2
3
4
5
6
7
8
9
10
11
12
13
fn example_random() {
    let rand = system_random();
    println!("A random number = {}", rand);

    let seed = b"a seed";
    let mut rnd = LinearCongruentialGenerator::from_seed(seed);
    let rand2 = rnd.generate_u8();
    println!("Another random number from seed {}", rand2);

    let random_str = rnd.generate_random_string(20);
    println!("A random String = {}", random_str);
}