Boost
Libraries
arrow_drop_down
Boost.Hash2
M
D

This Release

Peter Dimov
Peter Dimov
Maintainer
Christian Mazakas
Christian Mazakas
Maintainer

Dependencies

Library dependencies will be generated soon, please check back later.

Hash2, a hash function library

This library contains an extensible framework for implementing hashing algorithms that can support user-defined types, based on the paper "Types don't know #" by Howard Hinnant, Vinnie Falco and John Bytheway.

It also contains implementations of several popular hashing algorithms:

The hashing algorithms conform to the following concept:

struct HashAlgorithm
{
    using result_type = /*integral or array<unsigned char, N>*/; // result type

    HashAlgorithm(); // default-constructible
    explicit HashAlgorithm( uint64_t seed ); // seed-constructible
    HashAlgorithm( void const* seed, size_t n ); // seed-constructible

    HashAlgorithm( HashAlgorithm const& r ); // copy-constructible
    HashAlgorithm& operator=( HashAlgorithm const& r ); // assignable

    void update( void const* data, size_t n ); // feed bytes

    result_type result(); // obtain result; also advances state,
                          // and can be called multiple times
};

See the documentation for more information.

Supported compilers

The library requires C++11. The following compilers:

  • g++ 4.8 or later
  • clang++ 3.9 or later
  • Visual Studio 2015 and above

are being tested on Github Actions and Appveyor.

License

Distributed under the Boost Software License, Version 1.0.

All Time

Rene Rivera
Rene Rivera
Contributor
Dirk Stolle
Dirk Stolle
Contributor