Expand description
Hash functions and hash utilities
With the fast-sha1
feature, the Sha1
hash type will use a more elaborate implementation utilizing hardware support
in case it is available. Otherwise the rustsha1
feature should be set. fast-sha1
will take precedence.
Otherwise, a minimal yet performant implementation is used instead for a decent trade-off between compile times and run-time performance.
Structs§
- Hasher
fast-sha1
and (rustsha1
orfast-sha1
)A implementation of the Sha1 hash, which can be used once. - Write
rustsha1
orfast-sha1
A utility to automatically generate a hash while writing into an inner writer.
Functions§
- bytes
progress
and (rustsha1
orfast-sha1
)Similar tobytes_of_file
, but operates on a stream of bytes. - bytes_
of_ file progress
and (rustsha1
orfast-sha1
)Compute the hash ofkind
for the bytes in the file atpath
, hashing only the firstnum_bytes_from_start
while initializing and callingprogress
. - bytes_
with_ hasher progress
and (rustsha1
orfast-sha1
)Similar tobytes()
, but takes ahasher
instead of a hash kind. - crc32
crc32
Compute a CRC32 value of the given inputbytes
. - crc32_
update crc32
Compute a CRC32 hash from the givenbytes
, returning the CRC32 hash. - hasher
rustsha1
orfast-sha1
Produce a hasher suitable for the given kind of hash.