Skip to content

Commit b2b9fc1

Browse files
authored
Merge pull request #2 from Rashicom/Dev
Dev
2 parents 263f419 + ed70c46 commit b2b9fc1

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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

meow/password/passwords.py

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff 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"

0 commit comments

Comments
 (0)