2
0
mirror of https://github.com/boostorg/hash2.git synced 2026-01-19 04:12:12 +00:00
2025-04-19 19:02:58 +03:00
2025-04-19 19:02:58 +03:00
2025-03-03 20:09:57 +02:00
2025-03-13 12:49:24 -07:00
2025-04-15 11:21:56 -07:00
2025-03-18 13:36:20 -07:00
2024-07-17 21:30:16 +03:00
2025-03-18 13:36:20 -07:00
2025-04-19 19:02:58 +03:00
2018-01-06 16:45:24 +02:00
2024-12-03 22:26:40 +02:00
2020-08-27 17:01:33 +03:00
2024-12-02 18:28:57 +02:00
2024-12-03 22:26:40 +02:00
2024-07-03 21:07:44 +03:00
2025-03-03 16:36:41 +02:00

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.

Description
Mirrored via gitea-mirror
Readme 1 MiB
Languages
C++ 99.2%
CMake 0.6%
Shell 0.1%