This commit is contained in:
2026-04-17 00:51:32 -04:00
parent f8c97f71f8
commit 10f770e662
+1 -15
View File
@@ -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());
}