-
Notifications
You must be signed in to change notification settings - Fork 415
configurable collision checking #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 8 files reviewed, 2 unresolved discussions (waiting on @jarifibrahim and @manishrjain)
store.go, line 26 at r2 (raw file):
type storeItem struct { hashed uint64
call it key
store.go, line 176 at r2 (raw file):
} func (m *lockedMap) Update(hashed uint64, key, value interface{}) bool {
Just use keyHash or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 7 files at r2, 2 of 2 files at r3, 3 of 3 files at r4, 4 of 4 files at r5.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @jarifibrahim and @manishrjain)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r6.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @jarifibrahim and @manishrjain)
|
I'm confused, how is this going to help with collisions. Doesn't appending something to an input that already has a collision also produce a collision? If I use strings as keys, and I set I'm not familiar with I'm not aware of any |
|
@erikdubbelboer You appear to be correct. We assumed that the probability of collision was the same for different inputs, but it appears after one collision all bets are off. I'm going to assume Thanks for the heads up. |
|
Modern hashes do not process a single byte at a time. There is no reason to believe a collision for strings |
|
@dgryski that's a big assumption to make. I showed that it is the case for SHA1 and MD5. What if the last 3 bytes of the inputs were already the same but the rest was different? What I would suggest is doing an XOR with some pattern that changes for each hash N. |
Not finished yet, but for purposes of discussion, this is what I'm thinking for collision prevention.
This change is