mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-06 22:08:41 +00:00
xxhash for ctrl layer
This commit is contained in:
@@ -9,14 +9,16 @@
|
|||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
//~ rjf: Basic Type Functions
|
//~ 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
|
internal U64
|
||||||
ctrl_hash_from_string(String8 string)
|
ctrl_hash_from_string(String8 string)
|
||||||
{
|
{
|
||||||
U64 result = 5381;
|
U64 result = XXH3_64bits_withSeed(string.str, string.size, 5381);
|
||||||
for(U64 i = 0; i < string.size; i += 1)
|
|
||||||
{
|
|
||||||
result = ((result << 5) + result) + string.str[i];
|
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user