passphrasex_common 0.3.0

Common code for PassPhraseX
Documentation
1
2
3
4
5
6
7
8
9
10
11
pub mod dist;

use dist::PasswordDist;
use rand::distributions::DistString;

pub fn generate_password(length: usize) -> String {
    let mut rng = rand::thread_rng();
    let mut password = String::new();
    PasswordDist.append_string(&mut rng, &mut password, length);
    password
}