1 import hashlib 2 3 def md5_get(data): 4 ret = hashlib.md5("gfdwuqmo@md1.".encode("utf-8")) #加盐 5 ret.update(data.encode("utf-8")) #加密 6 result =ret.hexdigest() #执行 7 return result 8 9 10 rets = md5_get("666") 11 print(rets) 12 13 14 15 run_result: 16 6eb7cce806f6159ea359b21a6c41f7f1 #加密结果
凑字数:
原文:https://www.cnblogs.com/wanghong1994/p/11688839.html