commit | a66b491b30b3783527e746a2af6375e7a7fa59be | [log] [tgz] |
---|---|---|
author | Leonard Chan <leonardchan@google.com> | Thu Feb 20 18:30:55 2020 -0800 |
committer | Leonard Chan <leonardchan@google.com> | Thu Feb 20 18:30:55 2020 -0800 |
tree | 52a2a52636cccab6ee09184105b8860dfe49e292 | |
parent | bb3a13cb4378fdafcf365521bca5b3a062b9d856 [diff] |
[UBsan][murmurhash] Temporarily disable UBSan UBSan was reporting a zero-offset to nullptr. Disable UBSan for this target for now, then we will come back to fix it once asan-ubsan is migrated into CQ. Bug: 46777 Change-Id: I8ad1c255a568f940e27257526afec84d56538ac2
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