-/*
+/*
"Murmur" hash provided by Austin, tanjent@gmail.com
http://murmurhash.googlepages.com/
#include "common.h"
-uint32_t hashkit_murmur(const char *key, size_t length)
+uint32_t hashkit_murmur(const char *key, size_t length, void *context)
{
- /*
+ /*
'm' and 'r' are mixing constants generated offline. They're not
really 'magic', they just happen to work well.
*/
// Mix 4 bytes at a time into the hash
const unsigned char * data= (const unsigned char *)key;
+ (void)context;
while(length >= 4)
{
unsigned int k = *(unsigned int *)data;
- k *= m;
- k ^= k >> r;
- k *= m;
+ k *= m;
+ k ^= k >> r;
+ k *= m;
- h *= m;
+ h *= m;
h ^= k;
data += 4;
default: break;
};
- /*
+ /*
Do a few final mixes of the hash to ensure the last few bytes are
- well-incorporated.
+ well-incorporated.
*/
h ^= h >> 13;