diff options
author | Maria Matejka <mq@ucw.cz> | 2023-07-12 15:11:00 +0200 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2023-09-26 15:46:24 +0200 |
commit | 8674d7ab4bf76cadc256ca24609ffe4b1e8fcbf4 (patch) | |
tree | 946b2b478f35042f6e2d61b1a9eeb6fd3125e088 /lib | |
parent | 977b82fba49b22d9548546d88b105945921efaed (diff) |
Aggregator: Fixed hashing of adata
Diffstat (limited to 'lib')
-rw-r--r-- | lib/hash.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -216,6 +216,14 @@ mem_hash_mix(u64 *h, const void *p, uint s) } static inline void +mem_hash_mix_str(u64 *h, const char *s) +{ + const u64 multiplier = 0xb38bc09a61202731ULL; + while (s) + *h = *h * multiplier + *s++; +} + +static inline void mem_hash_mix_num(u64 *h, u64 val) { mem_hash_mix(h, &val, sizeof(val)); |