Hacker News new | ask | show | jobs
by ww520 3172 days ago
They are not. Multiple objects can map to the same hash key due to collision. Just because a hashtable containing the hash key of an object does not mean the object has been seen before. An object's hash key not contained in the hashtable definitely assures that the object has not been seen before.
2 comments

This is called the contrapositive of your statement. It's logically guaranteed.

No one is claiming that "if the hash matches the object must be there". They're saying "if the object is there, the hash will match". This is logically equivalent to saying "if the hash does not match, the object is not there".

GP is right; you need to be careful about how you read it.

“contains implies report” is different than “report implies contains”. You are (correctly) arguing the against latter statement, which GP does not make.