gix_features

Module hash

source
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§

  • Hasherfast-sha1 and (rustsha1 or fast-sha1)
    A implementation of the Sha1 hash, which can be used once.
  • Writerustsha1 or fast-sha1
    A utility to automatically generate a hash while writing into an inner writer.

Functions§

  • bytesprogress and (rustsha1 or fast-sha1)
    Similar to bytes_of_file, but operates on a stream of bytes.
  • bytes_of_fileprogress and (rustsha1 or fast-sha1)
    Compute the hash of kind for the bytes in the file at path, hashing only the first num_bytes_from_start while initializing and calling progress.
  • bytes_with_hasherprogress and (rustsha1 or fast-sha1)
    Similar to bytes(), but takes a hasher instead of a hash kind.
  • crc32crc32
    Compute a CRC32 value of the given input bytes.
  • Compute a CRC32 hash from the given bytes, returning the CRC32 hash.
  • hasherrustsha1 or fast-sha1
    Produce a hasher suitable for the given kind of hash.

Type Aliases§

  • Digestfast-sha1 or rustsha1
    A hash-digest produced by a Hasher hash implementation.