
5 Dec
2024
5 Dec
'24
12:27 a.m.
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".