Contents
API Documentation
Hashfun
repeat_hashfun
validate_hashfun_args
Utilities for hash function implementation.
Bases: Protocol
Protocol
Protocol for raw hash functions.
@runtime_checkable class Hashfun(Protocol): def __call__(self, data: BytesLike, size: Optional[int] = None) -> bytes: ...
Utility function for repeated hashing.
hashfun (Hashfun)
repeat (int; default = 1)
int
1
truncate (Literal['end', 'always']; default = 'end')
Literal
'end'
'always'
Utility function to validate the arguments passed to hash functions.
data (varint)
varint
size (Optional[int])
Optional
max_digest_size (Optional[int])
size_required (bool; default = False)
bool
False
name (str; default = '')
str
''
None