#My first lib in Rust

10 messages ยท Page 1 of 1 (latest)

normal kiln
#

Overall looks good ๐Ÿ‘

#

@north flicker Can you explain your score system?

jaunty rose
#

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,
        }
normal kiln
north flicker
#

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.

north flicker
#

I have made changes

north flicker
#

In the next update I will be check the password strength based on entropy

north flicker
#

i've added calculate password entropy function, I encourage to feedback again