From 7d2f79ba90313465931184bdd214c012f16cab12 Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Fri, 17 Jul 2026 13:32:23 +0200 Subject: [PATCH] feat: always use 64-bit hash computation This ensures consistent behaviour between architectures with different word sizes. On 64-bit architectures, this change has no impact. --- libfsst.cpp | 2 +- libfsst.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libfsst.cpp b/libfsst.cpp index e3ba787..5152a25 100644 --- a/libfsst.cpp +++ b/libfsst.cpp @@ -467,7 +467,7 @@ vector makeSample(u8* sampleBuf, const u8* strIn[], const size_t **le for(size_t i=0; i= 2); return 0xFFFF & load_num(); } #define FSST_HASH_LOG2SIZE 10 -#define FSST_HASH_PRIME 2971215073LL +#define FSST_HASH_PRIME 2971215073ULL #define FSST_SHIFT 15 #define FSST_HASH(w) (((w)*FSST_HASH_PRIME)^(((w)*FSST_HASH_PRIME)>>FSST_SHIFT)) - size_t hash() const { size_t v = 0xFFFFFF & load_num(); return FSST_HASH(v); } // hash on the next 3 bytes + u64 hash() const { u64 v = 0xFFFFFF & load_num(); return FSST_HASH(v); } // hash on the next 3 bytes }; // Symbol that can be put in a queue, ordered on gain