[*] Stop using the hashes used by Google by default

They had no reason to use these besides "lol clang/gcc containers sucked 10 years ago." Nobody has touched or questioned them since.
This commit is contained in:
Reece Wilson 2023-08-18 15:52:02 +01:00
parent b76a0a810e
commit ada2bffb0e

View File

@ -46,6 +46,7 @@ namespace AuHash
}
};
#if defined(_AU_WANT_GOOGLE_HASHES)
// Thomas Wang, Integer Hash Functions: https://web.archive.org/web/20061201032901/http://www.concentric.net/%7ETtwang/tech/inthash.htm
// Updated version under V8: V8/v9-11/src/utils/utils.h
//
@ -78,6 +79,17 @@ namespace AuHash
hash = hash ^ (hash >> 22); // ???????????
return hash;
}
#else
inline constexpr AuUInt32 ComputeUnseededHash(AuUInt32 key)
{
return AuFnv1aType<AuUInt32>(key);
}
inline constexpr AuUInt64 ComputeLongHash(AuUInt64 key)
{
return AuFnv1aType<AuUInt64>(key);
}
#endif
#define _HASH_INT(type) \
template <> \
@ -153,7 +165,7 @@ namespace AuHash
_HASH_INT32BIT(unsigned short);
_HASH_INT32BIT(int);
_HASH_INT32BIT(unsigned int);
_HASH_INT64BIT(long);
_HASH_INT64BIT(long); // I know, I don't care.
_HASH_INT64BIT(long long);
_HASH_INT64BIT(unsigned long);
_HASH_INT64BIT(unsigned long long);