第一题:
import hashlib def login(user, password): md5 = hashlib.md5() md5.update(password.encode('utf-8')) if db[user] and db[user]==md5.hexdigest(): return True else: return False
第二题:
def login(username, password): user = db[username] return user.password == get_md5(password+user.salt)
Sign in to make a reply
leo咕咕白
第一题:
第二题: