Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2024-12-05 00:27:41


Robert Ramey wrote:
> On 12/4/24 2:15 AM, Peter Dimov via Boost wrote:
>
> > unequal
> > arguments should produce different hash values.
> >
> > Since the arguments above are distinct (with respect to operator==),
> > they should produce distinct hash values.
> >
>
> What does "should" mean here? How could you possible make such a
> guarentee.

For a high quality hash function, the formal meaning of "should" is
that the probability for a collision must be 2^-n, where n is the number
of bits of the hash value. (That is, the hash values should be uniformly
distributed.)

For a cryptographic hash function, the formal meaning of "should" is
that engineering a collision should be "computationally infeasible".


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