import hashlib
# bytes
#哈希算法
password = "qwerasdfdfhdfhdhdfhdfhdfhdfhdfhdfh"
#md5
print(password.encode())
m = hashlib.sha3_512(password.encode())
# m = hashlib.md5(password.encode())
print(m.hexdigest())
#加盐
def md5(string,salt=""):
new = str(string) + str(salt)
m = hashlib.md5(new.encode())
return m.hexdigest()
#md5 sha256 sha512
#md5加密是不可逆的
#base64
#aes
#md5_passdword
#id before afeter
# 1 123456 350c9d901b7f1c73a481e240ec1b7c0b
#2 passwrod 350c9d901b7f1c73a481e240ec1b7c0b
Python数据加密(hashlib)
最新推荐文章于 2024-08-12 14:30:00 发布