Boost logo

Boost :

Subject: Re: [boost] [interprocess] boost::hash - different values for the same input?
From: Peter Dimov (lists_at_[hidden])
Date: 2016-01-14 14:22:35


Bjorn Reese wrote:
> The protocols I am using do not use fingerprinting for error correction
> but rather for identifying data chunks. See for instance:
>
> http://people.eng.unimelb.edu.au/jzobel/fulltext/jasist03thz.pdf
>
> You will notice that equation (1) on page 207 looks an awful lot like the
> default boost::hash implementation.

If you look at the Boost.Hash documentation in

http://www.boost.org/doc/libs/1_60_0/doc/html/hash/rationale.html

you'll see that it points to issue 6.18 of

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1837.pdf

which (at page 67) says that the proposed hash_combine is taken from that
very paper. :-)

We just added a constant offset during the review because otherwise 0 was a
trap.

My original idea was for hash_combine to be completely specified and
therefore the behavior of boost::hash to be completely predictable from the
values of the input.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk