diff options
Diffstat (limited to 'qstd/str.c')
-rw-r--r-- | qstd/str.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -11,6 +11,15 @@ uint64_t fnv1a64(uint8_t* buf, size_t size) { return hash; } +uint64_t fnv1a64_2(uint64_t hash, uint8_t* buf, size_t size) { + size_t i; + for (i = 0; i < size; i++, buf++) { + hash ^= *buf; + hash *= 0x100000001b3; + } + return hash; +} + uint32_t hash_string(const char* s) { uint32_t h = 2166136261u; for (; *s; s++) { |