python基础篇 25-md5 sha384加密工具
import hashlib s = 'huoziyang123' + 'sd23$@#%G@#25'#盐 s = s.encode() m = hashlib.sha384(s) #bytes,不可逆 result = m.hexdigest() def my_md5(s): s = str(s) s = s.encode() m = hashlib.md5(s) # bytes,不可逆 result = m.hexdigest() return result print(result)