commit | a0d818498384dc023e5faf36de31daf700d2b179 | [log] [tgz] |
---|---|---|
author | Stephen Mathieson <me@stephenmathieson.com> | Fri May 09 11:01:49 2014 -0400 |
committer | Stephen Mathieson <me@stephenmathieson.com> | Fri May 09 11:01:49 2014 -0400 |
tree | 187d18eae913548284f7ed42e4a2fa0e44527792 | |
parent | c730170f28e35541a7dd53ac054f1f327a327555 [diff] |
typo
MurmurHash3 general hash bashed lookup function implementation
MurmurHash is a non-cryptographic hash function suitable for general hash-based lookup. This implementation implements version 3 of MurmurHash.
clib:
$ clib install jwerle/murmurhash.c
source:
$ git clone git@github.com:jwerle/murmurhash.c.git $ cd murmurhash.c $ make $ make install
#include <stdlib.h> #include <string.h> #include <murmurhash.h> int main (void) { uint32_t seed = 0; const char *key = "kinkajou"; uint32_t hash = murmurhash(key, (uint32_t) strlen(key), seed); // 0xb6d99cf8 return 0; }
A command line executable is also available:
$ echo -n kinkajou | murmur 3067714808
$ echo -n panda | murmur --seed=10 1406483717
uint32_t murmurhash (const char *key, uint32_t len, uint32_t seed);
Returns a murmur hash of key
based on seed
using the MurmurHash3 algorithm.
MIT