-
Notifications
You must be signed in to change notification settings - Fork 207
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
Add murmur3 32-bit #101
Add murmur3 32-bit #101
Conversation
Also rename the existing `murmur` to `murmur-128`.
@@ -62,7 +62,8 @@ keccak-224,keccak has variable output length. The number specifies the core leng | |||
keccak-256, , 0x1B | |||
keccak-384, , 0x1C | |||
keccak-512, , 0x1D | |||
murmur3, , 0x22 | |||
murmur3-128, , 0x22 | |||
murmur3-32, , 0x23 |
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.
Let's be careful about allocating another single-byte code. Really, we shouldn't have allocated single byte codes to most of these but, IIRC, we did that before we combined the various codec tables.
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.
I took it from the JS Multihash implementation https://github.com/multiformats/js-multihash/blob/443a8ebdd145582f2cac6e708ffe890401d5de08/src/constants.js#L22
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.
Damn.
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.
It's even in the multihash RFC draft: https://tools.ietf.org/html/draft-multiformats-multihash-00
Addressing @Kubuxu's comment (#45 (comment)) on the previous PR: Murmur3-64 is actually just a truncated murmur3-128. Given how we use these hashes in sharded directories, this doesn't make a difference (we might as well use murmur3-128). So, the only issues here are:
@pgte make sense? Which murmur hash are you using? |
@Stebalien the only time I remember needing murmur was when implementing dir sharding here: |
As far as I can tell, we use as many bytes as we need. Using 8 bytes (64 bits) would mean an 8-deep hamt (which we shouldn't normally have). However, I've actually just changed the go implementation to support using all 16 bytes of the 128 bit hash (to reduce confusion): ipfs/go-unixfs#53. |
Merged as this:
If we want to free up some of these IDs, we can consider that separately (but probably shouldn't at this point). |
Also rename the existing
murmur
tomurmur-128
.