From 8674d7ab4bf76cadc256ca24609ffe4b1e8fcbf4 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Wed, 12 Jul 2023 15:11:00 +0200 Subject: Aggregator: Fixed hashing of adata --- lib/hash.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/hash.h') diff --git a/lib/hash.h b/lib/hash.h index b30f7830..3c173958 100644 --- a/lib/hash.h +++ b/lib/hash.h @@ -215,6 +215,14 @@ mem_hash_mix(u64 *h, const void *p, uint s) *h = *h * multiplier + pp[i]; } +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) { -- cgit v1.2.3