On Sep 7, 2017, at 12:11 PM, Vinnie Falco via Boost
On Thu, Sep 7, 2017 at 8:30 AM, Niall Douglas via Boost
wrote: I vaguely remember that...Howard had some WG21 proposal for a standardised hashing infrastructure? One not fundamentally broken like std::hash. One should probably study/implement that proposal.
You're thinking of hash_append, described here:
http://htmlpreview.github.io/?https://github.com/HowardHinnant/papers/blob/m...
Repository:
https://github.com/howardhinnant/hash_append
This library is designed for non-cryptographic hashing. Specifically for unordered containers (hash tables). The requirements for cryptographic hash algorithms are different, and difficult to unify with the use-case for hash tables.
For example when calculating the cryptographic digest on serialized data, endianness of integers matters.
endian taken into account here: https://github.com/HowardHinnant/hash_append/blob/master/sha256.h#L30 (example sha256 hasher) xstd::endian is now C++17 (as std::endian, 23.15.9 [meta.endian]). Howard