diff --git a/src/ctrl/ctrl_core.c b/src/ctrl/ctrl_core.c index 2415dc36..26b59be8 100644 --- a/src/ctrl/ctrl_core.c +++ b/src/ctrl/ctrl_core.c @@ -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; }