From aa2a1bf583b5677eee8dc47b9457a0c1d3c494c8 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Fri, 28 Jun 2024 18:19:29 +0900 Subject: [PATCH] Fix hashing in hash_map (hopefully finally) --- src/data_structures/hash_map.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/data_structures/hash_map.c b/src/data_structures/hash_map.c index 3804f74..f5653ad 100644 --- a/src/data_structures/hash_map.c +++ b/src/data_structures/hash_map.c @@ -74,8 +74,7 @@ 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 + count)) - << (8 * count); + temp |= ((unsigned long long)*((unsigned char *)key + idx)) << (8 * count); ++count; if (count >= 8) { count = 0;