标签:等价 int sha1 加密 digest odi hex import enc
# coding=utf-8
import base64
from hashlib import sha1
sha= sha1()
sha.update(b"aaa"+b"bbb") # 字符串相加等价于两次update
# sha.update(b‘bbb‘)
aa=sha.hexdigest()
str=aa.encode(‘utf-8‘)
bs64=base64.b64encode(str)
print(bs64)
#b‘NjhkODU3MmMyNjYyYjBmMDZmNzIzZDdkNTA3OTU0ZmIwMzhiODU1OA==‘
#b‘NjhkODU3MmMyNjYyYjBmMDZmNzIzZDdkNTA3OTU0ZmIwMzhiODU1OA==‘
标签:等价 int sha1 加密 digest odi hex import enc
原文地址:https://www.cnblogs.com/SunshineKimi/p/12397557.html