Hash Functions (primarily for hashmap/sets)
include/math/hash.h View source View on GitHubFunctions
Section titled “Functions”hash_djb2
Section titled “hash_djb2”uint32_t hash_djb2(const void *key, size_t len); hash_sdbm
Section titled “hash_sdbm”uint32_t hash_sdbm(const void *key, size_t len); hash_fnv1a
Section titled “hash_fnv1a”uint32_t hash_fnv1a(const void *key, size_t len); hash_fnv1a_64_update
Section titled “hash_fnv1a_64_update”uint64_t hash_fnv1a_64_update(uint64_t hash, const void *key, size_t len); hash_fnv1a_64
Section titled “hash_fnv1a_64”uint64_t hash_fnv1a_64(const void *key, size_t len); hash_jenkins_one_at_a_time
Section titled “hash_jenkins_one_at_a_time”uint32_t hash_jenkins_one_at_a_time(const void *key, size_t len); hash_murmur3_32
Section titled “hash_murmur3_32”uint32_t hash_murmur3_32(const void *key, size_t len, uint32_t seed); hash_elf
Section titled “hash_elf”uint32_t hash_elf(const void *key, size_t len); hash_bkdr
Section titled “hash_bkdr”uint32_t hash_bkdr(const void *key, size_t len); Macros
Section titled “Macros”HASH_FNV1A_64_OFFSET_BASIS
Section titled “HASH_FNV1A_64_OFFSET_BASIS”#define HASH_FNV1A_64_OFFSET_BASIS UINT64_C(14695981039346656037) HASH_FNV1A_64_PRIME
Section titled “HASH_FNV1A_64_PRIME”#define HASH_FNV1A_64_PRIME UINT64_C(1099511628211)