一、 import hashlib
def login(user, password): if db[user] == hashlib.md5(password.encode('utf-8')).hexdigest(): return True 二、
def login(username, password): user = db[username] return user.password == get_md5(password + user.salt)
Sign in to make a reply
冲浪小白兔
一、 import hashlib
def login(user, password): if db[user] == hashlib.md5(password.encode('utf-8')).hexdigest(): return True 二、
def login(username, password): user = db[username] return user.password == get_md5(password + user.salt)