Skip to content

MurmurHash3 general hash bashed lookup function implementation

License

Notifications You must be signed in to change notification settings

Ambier/murmurhash.c

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

murmurhash

MurmurHash3 general hash bashed lookup function implementation

about

MurmurHash is a non-cryptographic hash function suitable for general hash-based lookup. This implementation implements version 3 of MurmurHash.

install

clib:

$ clib install jwerle/murmurhash.c

source:

$ git clone git@github.com:jwerle/murmurhash.c.git
$ cd murmurhash.c
$ make
$ make install

example

#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

api

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

About

MurmurHash3 general hash bashed lookup function implementation

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 92.3%
  • Makefile 7.7%