From: Stephen Seo Date: Fri, 28 Jun 2024 09:19:29 +0000 (+0900) Subject: Fix hashing in hash_map (hopefully finally) X-Git-Tag: 1.0~100 X-Git-Url: https://git.seodisparate.com/gitweb?a=commitdiff_plain;h=aa2a1bf583b5677eee8dc47b9457a0c1d3c494c8;p=SimpleArchiver Fix hashing in hash_map (hopefully finally) --- 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;