-
Notifications
You must be signed in to change notification settings - Fork 12
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
mumurhash32 collision between ufo
and vue
#11
Comments
-> revert once unjs/ohash#11 resolved
-> revert once unjs/ohash#11 resolved
-> revert once unjs/ohash#11 resolved
Another collision:
Ref: nuxt/nuxt#14313 |
ufo
and vue
ufo
and vue
Using SHA2 in latest 0.1.x #12 |
Just a shot in the dark, but it seems collisions can be easily avoided with import { murmurHash } from 'ohash'
const fixedHash = (s) => murmurHash(s.padEnd(s.length + (4 - (s.length & 3)) & 3, '\0'))
fixedHash('vue') // => 2175094470
fixedHash('ufo') // => 3195201511
fixedHash('/node_modules/vue-toastification/dist/index.mjs')
// => 1385894279
fixedHash('/node_modules/vue-toastification/dist/index.css')
// => 3153126526 I'm not sure if this really fixes it or not, to be honest. :) From this article:
So perhaps making sure that Line 18 in 58a0d67
My hypothesis is basically, "No collisions exist for modulus 4 length strings." Again, no idea if it's sound. |
Really nice point @aleclarson thanks for sharing article. Do you mind to open a PR directly adding fix to murmurHash function? (Also maybe few tests) |
Done in #83 |
related: nuxt/framework#5398
The text was updated successfully, but these errors were encountered: