您的位置:首页 > 其它

判断你设置的密码的强度

2016-11-18 12:45 176 查看
def judgePasswordStrength(password):
strengthLength = max(0, len(password) - 5)
from string import ascii_lowercase, ascii_uppercase, digits, punctuation
flags = [bool(set(password) & set(s)) \
for s in [ascii_lowercase, ascii_uppercase, digits, punctuation]]
return min(flags.count(True), strengthLength)


  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: