Lumiera
0.pre.03
»edit your freedom«
|
Go to the source code of this file.
Implementation of FNV ("Fowler-Noll-Vo") hashing functions.
Definition in file hash-fnv.c.
Functions | |
uint32_t | hash_fnv32_retry (uint64_t hash, uint32_t limit) |
reduce hash to be within 0 to limit-1. More... | |
uint32_t | hash_fnv32_xorfold (uint32_t hash, int bits) |
reduce a hash value to n bits. More... | |
uint32_t | hash_fnv32a_buf (const void *buf, size_t len, uint32_t hval) |
FNV-1a 32 bit hash over a buffer. More... | |
uint32_t | hash_fnv32a_strn (const char *str, size_t len, uint32_t hval) |
FNV-1a 32 bit hash over a zero terminated string. More... | |
uint64_t | hash_fnv64_retry (uint64_t hash, uint64_t limit) |
reduce hash to be within 0 to limit-1. More... | |
uint64_t | hash_fnv64_xorfold (uint64_t hash, int bits) |
reduce a hash value to n bits. More... | |
uint64_t | hash_fnv64a_buf (const void *buf, size_t len, uint64_t hval) |
FNV-1a 64 bit hash over a buffer. More... | |
uint64_t | hash_fnv64a_strn (const char *str, size_t len, uint64_t hval) |
FNV-1a 64 bit hash over a zero terminated string. More... | |
uint64_t hash_fnv64a_buf | ( | const void * | buf, |
size_t | len, | ||
uint64_t | hval | ||
) |
FNV-1a 64 bit hash over a buffer.
buf | start of the buffer |
len | size of the buffer |
hval | previous hash value when incremental hashing or HASH_FNV64_BASE when starting a new hash |
Definition at line 37 of file hash-fnv.c.
uint32_t hash_fnv32a_buf | ( | const void * | buf, |
size_t | len, | ||
uint32_t | hval | ||
) |
FNV-1a 32 bit hash over a buffer.
buf | start of the buffer |
len | size of the buffer |
hval | previous hash value when incremental hashing or HASH_FNV32_BASE when starting a new hash |
Definition at line 53 of file hash-fnv.c.
uint64_t hash_fnv64a_strn | ( | const char * | str, |
size_t | len, | ||
uint64_t | hval | ||
) |
FNV-1a 64 bit hash over a zero terminated string.
str | start of the buffer |
len | maximum size to be processed |
hval | previous hash value when incremental hashing or HASH_FNV64_BASE when starting a new hash |
Definition at line 68 of file hash-fnv.c.
uint32_t hash_fnv32a_strn | ( | const char * | str, |
size_t | len, | ||
uint32_t | hval | ||
) |
FNV-1a 32 bit hash over a zero terminated string.
str | start of the buffer |
len | maximum size to be processed |
hval | previous hash value when incremental hashing or HASH_FNV32_BASE when starting a new hash |
Definition at line 84 of file hash-fnv.c.
uint64_t hash_fnv64_xorfold | ( | uint64_t | hash, |
int | bits | ||
) |
reduce a hash value to n bits.
Uses the xor folding method to stash a hash value together, this preserves unbiased hash distribution
hash | result from one of the 64 bit hash functions above |
bits | number of significat bits for the result |
Definition at line 100 of file hash-fnv.c.
uint32_t hash_fnv32_xorfold | ( | uint32_t | hash, |
int | bits | ||
) |
reduce a hash value to n bits.
Uses the xor folding method to stash a hash value together, this preserves unbiased hash distribution
hash | result from one of the 32 bit hash functions above |
bits | number of significat bits for the result |
Definition at line 119 of file hash-fnv.c.
uint64_t hash_fnv64_retry | ( | uint64_t | hash, |
uint64_t | limit | ||
) |
reduce hash to be within 0 to limit-1.
Uses the retry method to limit a hash value, this preserves unbiased hash distribution.
hash | result from one of the 64 bit hash functions above |
limit | upper limit plus one for the result |
Definition at line 138 of file hash-fnv.c.
uint32_t hash_fnv32_retry | ( | uint64_t | hash, |
uint32_t | limit | ||
) |
reduce hash to be within 0 to limit-1.
Uses the retry method to limit a hash value, this preserves unbiased hash distribution.
hash | result from one of the 32 bit hash functions above |
limit | upper limit plus one for the result |
Definition at line 150 of file hash-fnv.c.