File tree Expand file tree Collapse file tree 2 files changed +35
-2
lines changed Expand file tree Collapse file tree 2 files changed +35
-2
lines changed Original file line number Diff line number Diff line change 11# Meow
2-
2+ 'Package for passowrd generation'
33[ ![ PyPI - Version] ( https://img.shields.io/pypi/v/meow.svg )] ( https://pypi.org/project/meow )
44[ ![ PyPI - Python Version] ( https://img.shields.io/pypi/pyversions/meow.svg )] ( https://pypi.org/project/meow )
55
Original file line number Diff line number Diff line change @@ -37,4 +37,37 @@ def generate_memmory_password():
3737 secret = get_random_password (length = 4 )
3838
3939 # Combine the animal name, positive adjective, and secret and return the result
40- return f"{ positive_adjective } _{ animal_name } _{ secret } "
40+ return f"{ positive_adjective } _{ animal_name } _{ secret } "
41+
42+
43+ def check_password_strength (password ):
44+ """
45+ This method checks the strength of a given password.
46+ It checks the following:
47+ 1. Length: At least 8 characters.
48+ 2. At least one uppercase letter.
49+ 3. At least one lowercase letter.
50+ 4. At least one digit.
51+ 5. At least one special character.
52+ """
53+ # Check length
54+ if len (password ) < 8 :
55+ return "Weak"
56+
57+ # Check for uppercase letters
58+ if not any (char .isupper () for char in password ):
59+ return "Weak"
60+
61+ # Check for lowercase letters
62+ if not any (char .islower () for char in password ):
63+ return "Weak"
64+
65+ # Check for digits
66+ if not any (char .isdigit () for char in password ):
67+ return "Weak"
68+
69+ # Check for special characters
70+ if not any (char in string .punctuation for char in password ):
71+ return "Weak"
72+
73+ return "Strong"
You can’t perform that action at this time.
0 commit comments