December 19, 2015 Re: MurmurHash3 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Guillaume Chatelet | The last version of the code is available here and is feature complete AFAICT https://github.com/gchatelet/murmurhash3_d/blob/master/murmurhash3.d Last concern, I declared blockSize in bytes where std.digest.digest says it should be in bits. Why does it need to be bits ? It looks like HMAC (which needs it) is explicitly making sure it's always a multiple of 8 bits. |
December 20, 2015 Re: MurmurHash3 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Guillaume Chatelet | On Saturday, 19 December 2015 at 22:15:14 UTC, Guillaume Chatelet wrote:
> The last version of the code is available here and is feature complete AFAICT
> https://github.com/gchatelet/murmurhash3_d/blob/master/murmurhash3.d
>
> Last concern, I declared blockSize in bytes where std.digest.digest says it should be in bits. Why does it need to be bits ? It looks like HMAC (which needs it) is explicitly making sure it's always a multiple of 8 bits.
I was the one who introduced it, and I chose bits instead of bytes because I didn't want to exclude the possibility that there are hashing algos that have a block size not divisible by 8. The algorithms are usually described in terms of bits, not bytes, so it's not unconceivable that such hash functions exist, though I don't know any. (Of course, HMAC wouldn't work with those, but that doesn't mean that other algorithms couldn't.)
I'd suggest you change `blockSize` to the number of bits, and introduce an enum `blockSizeInBytes` for internal use.
|
Copyright © 1999-2021 by the D Language Foundation