xxhash for ctrl layer

This commit is contained in:
Ryan Fleury
2025-08-05 09:27:31 -07:00
parent cff6426741
commit 1856c52e58
+7 -5
View File
@@ -9,14 +9,16 @@
////////////////////////////////
//~ rjf: Basic Type Functions
#if !defined(XXH_IMPLEMENTATION)
# define XXH_IMPLEMENTATION
# define XXH_STATIC_LINKING_ONLY
# include "third_party/xxHash/xxhash.h"
#endif
internal U64
ctrl_hash_from_string(String8 string)
{
U64 result = 5381;
for(U64 i = 0; i < string.size; i += 1)
{
result = ((result << 5) + result) + string.str[i];
}
U64 result = XXH3_64bits_withSeed(string.str, string.size, 5381);
return result;
}