#My first lib in Rust
10 messages ยท Page 1 of 1 (latest)
You should use an enum instead of strings for the password strength result.
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum PasswordStrength {
Weak,
Medium,
Strong,
}
pub fn check_password_strength(password: &str) -> PasswordStrength {
match score {
0..=3 => PasswordStrength::Weak,
4..=6 => PasswordStrength::Medium,
_ => PasswordStrength::Strong,
}
https://github.com/Larmbs/SecurePass I made corrections here @north flicker If you have any questions let me know.
A password generator and balancer library in Rust. Contribute to Larmbs/SecurePass development by creating an account on GitHub.
thanks, I will look and apply changes tomorrow
yes, my score system is based on few requirements and dictonary. On first I filter the most used words from password using a dictionary, after that I check a password has one: number, low char, upper char, special char. Next param is lenght.
I have made changes
In the next update I will be check the password strength based on entropy
i've added calculate password entropy function, I encourage to feedback again