cleanup
This commit is contained in:
+1
-15
@@ -27,6 +27,7 @@ struct PasswordConfig {
|
||||
charset: CharSet,
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
struct PasswordPolicy(PasswordConfig);
|
||||
|
||||
// todo: support multiple password policies
|
||||
@@ -60,20 +61,6 @@ impl Default for PasswordConfig {
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for PasswordPolicy {
|
||||
fn default() -> Self {
|
||||
let charset = CharSet::UPPERCASE |
|
||||
CharSet::LOWERCASE |
|
||||
CharSet::NUMBERS;
|
||||
let config = PasswordConfig {
|
||||
len: 16,
|
||||
charset
|
||||
};
|
||||
Self { 0: config }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fn random_ascii(rng: &mut OsRng, char_set: &[u8]) -> u8 {
|
||||
// NOT IDEAL FOR CRYPTO/password generation
|
||||
// let range_max = 122; // 125 - 33
|
||||
@@ -164,5 +151,4 @@ fn main() {
|
||||
|
||||
let phrase = generate_passphrase(3, &word_list, '-', &mut rng);
|
||||
println!("generated passphrase: {}", phrase.as_str());
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user