From da72a2387fdca02054eaf0a0bba1e96f79041021 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Fri, 28 Jun 2024 18:17:38 +0900 Subject: [PATCH] Fix hash_map hashing (hopefully the final time) --- src/data_structures/hash_map.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/data_structures/hash_map.c b/src/data_structures/hash_map.c index 2d97602..3804f74 100644 --- a/src/data_structures/hash_map.c +++ b/src/data_structures/hash_map.c @@ -74,7 +74,8 @@ unsigned long long simple_archiver_hash_map_internal_key_to_hash( unsigned long long temp = 0; unsigned int count = 0; for (unsigned int idx = 0; idx < key_size; ++idx) { - temp |= ((unsigned long long)*((unsigned char *)key)) << (8 * count); + temp |= ((unsigned long long)*((unsigned char *)key + count)) + << (8 * count); ++count; if (count >= 8) { count = 0;