Discuss / Python / 作业

作业

Topic source

云端67395

#1 Created at ... [Delete] [Delete and Lock User]

第一题 import hashlib

def login(user, password): md5 = hashlib.md5() md5.update(password.encode('utf-8')) if db[user] == md5.hexdigest(): return True return False 第二题

def login(username, password): user = db[username] return user.password == get_md5(password + user.salt)


  • 1

Reply