On Mon, 18 Apr 2016 07:03:03 -0400
Vinnie Falco
On Mon, Apr 18, 2016 at 6:55 AM, Thijs van den Berg
wrote: Maybe it's a good idea to release you version using the std::hash (or boost:hash) interface, although a separte library of common predefined hash function would be a more natural place for it?
We've got a proposal winding its way through the C++ standard process which provides a new interface to computing hashes on objects suitable for use with unordered containers: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3980.html
The problem is that while these interfaces are great for the purposes of generating 32-bit or 64-bit digests for hash tables, they are deficient for cryptographic purposes (i.e. producing a message authentication code). For example, regular std::hash doesn't deal with endiannes. But computing a cryptographic digest must yield the same results on all platforms, and therefore cares about endianness.
The hash function could return a machine independent value like
`std::array