add array hash function

This commit is contained in:
Matthew 2025-08-23 04:53:44 +10:00
parent 67c7c636d0
commit 32d375fec6

6
util.d
View File

@ -395,6 +395,12 @@ Delete(K, V)(HashTable!(K, V)* ht, K key)
const u64 HASH_SEED = 5995;
pragma(inline): u64
Hash(T)(T[] value)
{
return xxh3_64bits_withSeed(value.ptr, (T.sizeof * value.length) / u8.sizeof, HASH_SEED);
}
pragma(inline): u64
Hash(T)(T* value)
{