Skip to content

Instantly share code, notes, and snippets.

@tioover
Created January 14, 2012 09:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tioover/1610800 to your computer and use it in GitHub Desktop.
Save tioover/1610800 to your computer and use it in GitHub Desktop.
判断傻密码的函数
def is_stupid_password(password):
'''look here http://coolshell.cn/articles/6193.html .'''
stupid_password_list = [
'123456789',
'12345678',
'dearbook',
'123123123',
'1234567890',
'147258369',
'987654321',
]
clean = list(set(password)) # 如果是 aaaaaaa这样的密码,就会返回['a']
if password in stupid_password_list or len(clean) is 1:
return True
else: return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment