Skip to content

Commit

Permalink
started writing function, not complete
Browse files Browse the repository at this point in the history
  • Loading branch information
Kierst01 committed Jan 17, 2024
1 parent 81097f3 commit 391b7bd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/passwordler/password_strength.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import re


def password_strength(password):

"""
Tests the strength of a password.
Expand All @@ -12,4 +16,8 @@ def password_strength(password):
Returns:
str: a rating of either 'weak', 'good' or 'strong'
"""

count_special = password.count(["!", "@", "~", "#", "$", "%", '^', '&', '*', '(', ')', '?', '[', ']', '{', '}'])
count_lowercase = len(re.findall("[a-z]", password))
count_uppercase = password.count("[A-Z]")
count_numeric = password.count([0-9])
return 2

0 comments on commit 391b7bd

Please sign in to comment.