# 散列算法分析用户的账户密码正确与否,正确登录
import hashlib
db = {
'michael': 'e10adc3949ba59abbe56e057f20f883e',
'bob': '878ef96e86145580c38c87f0410ad153',
'alice': '99b1c2188db85afee403b1536010c2c9'
}
def login(user, password):
md5 = hashlib.md5()
md5.update(password.encode("utf-8"))
if db[user] == md5.hexdigest():
print("You are login!")
if __name__ == '__main__':
login("michael", "123456")
python3 login代码
最新推荐文章于 2022-05-21 13:46:53 发布