mirror of
https://github.com/FEX-Emu/xxHash.git
synced 2024-11-28 01:00:56 +00:00
refactored xxh3_64:4-8
purely bijective for each len
This commit is contained in:
parent
82bac5e4e4
commit
d34d978edb
8
xxh3.h
8
xxh3.h
@ -309,10 +309,10 @@ XXH3_len_4to8_64b(const void* data, size_t len, const void* keyPtr, XXH64_hash_t
|
||||
assert(data != NULL);
|
||||
assert(len >= 4 && len <= 8);
|
||||
{ const U32* const key32 = (const U32*) keyPtr;
|
||||
U32 const l1 = XXH_readLE32(data) + (U32)seed + key32[0];
|
||||
U32 const l2 = XXH_readLE32((const BYTE*)data + len - 4) + (U32)(seed >> 32) + key32[1];
|
||||
U64 const acc = len + l1 + ((U64)l2 << 32) + XXH_mult32to64(l1, l2);
|
||||
return XXH3_avalanche(acc);
|
||||
U32 const l1 = XXH_readLE32(data) ^ key32[0];
|
||||
U32 const l2 = XXH_readLE32((const BYTE*)data + len - 4) ^ key32[1];
|
||||
U64 const ll1 = l1 + ((U64)l2 << 32) + seed;
|
||||
return XXH3_avalanche(len + (ll1 * PRIME64_1));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user