标签:digest res word result alt inpu port str pytho
import hashlib #md5加密 h = ‘xmb‘ m = hashlib.md5(h.encode()) result = m.hexdigest() #获取加密后的结果 print(result) #加盐 y = ‘abc‘ password = input(‘password:‘) password = password + y m = hashlib.md5(password.encode()) result = m.hexdigest() #获取加密后的结果 print(result)
def md5(s,salt=‘‘): new_s = str(s) + salt m = hashlib.md5(new_s.encode()) return m.hexdigest()
标签:digest res word result alt inpu port str pytho
原文地址:https://www.cnblogs.com/xumb/p/11886256.html