import hashlib # 计算 MD5 口令 def calc_md5(password): md5 = hashlib.md5() md5.update(password.encode('utf-8')) return md5.hexdigest() # 验证用户登录 def login(user, password): if user in db: return db[user] == calc_md5(password) else: return False
Sign in to make a reply
Super-String