
On 12/4/24 5:15 AM, Peter Dimov via Boost wrote:
Alexander Grund wrote:
On the other hand, it makes it trivial to generate collisions
pair
( "foo", "bar" ) pair ( "foob", "ar" ) pair ( "fooba", "r" ) I can imagine an argument that the "collision" is intentional here, i.e. that the `data` really is just "foobarfoobarfoobar" I'm sure you can, but there are actual rules governing the behavior of hash functions that don't depend on people imagining things.
Equal arguments must produce the same hash value, and unequal arguments should produce different hash values.
Since the arguments above are distinct (with respect to operator==), they should produce distinct hash values. Both astute and absolutely correct. Thank you Peter.
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost