安装
pip install cryptography
使用方法
from cryptography.hazmat.primitives import hashes
digest = hashes.Hash(hashes.SHA256())
# digest = hashes.Hash(hashes.SHA3_256())
# digest = hashes.Hash(hashes.SM3())
digest.update(b"abc")
print(digest.finalize())
pip install cryptography
from cryptography.hazmat.primitives import hashes
digest = hashes.Hash(hashes.SHA256())
# digest = hashes.Hash(hashes.SHA3_256())
# digest = hashes.Hash(hashes.SM3())
digest.update(b"abc")
print(digest.finalize())