diff options
author | Joseph Werle <joseph.werle@gmail.com> | 2014-05-05 09:05:32 -0400 |
---|---|---|
committer | Joseph Werle <joseph.werle@gmail.com> | 2014-05-05 09:05:32 -0400 |
commit | 404fcbe88727c94236dac5cfb2a3191b6ba5f397 (patch) | |
tree | 2e3c8d8e456fa33adaed0b94e6039e773ccde497 /README.md | |
parent | 339adb3600c15d3d61320ed729bd5f002f7d7e94 (diff) |
update readme
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 48 |
1 files changed, 46 insertions, 2 deletions
@@ -1,4 +1,48 @@ -murmurhash.c -============ +murmurhash +=========== MurmurHash3 general hash bashed lookup function implementation + +## about + +[MurmurHash](http://en.wikipedia.org/wiki/MurmurHash) is a non-cryptographic hash function suitable +for general hash-based lookup. This implementation implements version 3 +of MurmurHash. + +## install + +[clib](https://github.com/clibs/clib): + +```sh +$ clib install jwerle/murmurhash.c +``` + +## example + +```c + +#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; +} +``` + +## api + +```c +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. + +## license + +MIT |