crypto.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:endosome 作者: teor2345 项目源码 文件源码
def hash_bytes(data_bytes, output_len=None, algorithm=hashes.SHA1()):
    '''
    Extract and return output_len bytes from a hash of data_bytes.
    If output_len is None, return the full hash length.
    '''
    hash_context = hash_create(algorithm=algorithm)
    hash_context = hash_update(hash_context, data_bytes)
    return hash_extract(hash_context,
                        output_len=output_len,
                        make_context_reusable=False)

# Tor-specific hash functions
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号