commit | 2ffa9cee1d5fd139bae38da07f27233930dcd7ef | [log] [tgz] |
---|---|---|
author | Simon Shields <simonshields@google.com> | Tue Dec 08 11:31:20 2020 +1100 |
committer | Simon Shields <simonshields@google.com> | Tue Dec 08 23:36:06 2020 +0000 |
tree | 5764339477f86d78720f038cf53c67b71c9a99bc | |
parent | a66b491b30b3783527e746a2af6375e7a7fa59be [diff] |
[murmurhash] Re-enable ubsan for murmurhash. Bug: 46777 Change-Id: I8a20774a27f9c63e3afc1aa53ee56faf25d3b90a Reviewed-on: https://fuchsia-review.googlesource.com/c/third_party/murmurhash.c/+/459034 Reviewed-by: Leonard Chan <leonardchan@google.com>
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