def hash_create(algorithm=hashes.SHA1()):
'''
Create and return a new hash context for algorithm.
Tor cells use SHA1 as a hash algorithm, except for v3 onion services,
which use SHA3-256 for client to service cells.
'''
# cryptography doesn't have a SHA3 implementation (as of July 2017)
return hashes.Hash(algorithm, backend=backends.default_backend())
评论列表
文章目录