[+] AuFnv1aPtr and AuFnv1a(str, len)

This commit is contained in:
Reece Wilson 2022-05-24 09:59:50 +01:00
parent 6e8c87edd4
commit 68cf9de104

View File

@ -52,11 +52,22 @@ inline constexpr AuUInt AuFnv1aType(const T &type, const AuUInt value = kFnv1Mag
return AuFnv1aType(((const char *)&type) + 1, sizeof(T), 1, (value ^ AuUInt(*(const char *)&type) * kFnv1MagicPrimePlatform));
}
template <class T>
inline constexpr AuUInt AuFnv1aPtr(const T *const type, AuUInt length, const AuUInt value = kFnv1MagicValPlatform) noexcept
{
return AuFnv1aType(((const char *)type) + 1, length, 1, (value ^ AuUInt(*(const char *)type) * kFnv1MagicPrimePlatform));
}
inline constexpr auto AuFnv1a(const char *const str) noexcept
{
return _AU_FNV1_32 ? AuFnv1a32(str) : AuFnv1a64(str);
}
inline constexpr auto AuFnv1a(const char *const str, AuUInt length) noexcept
{
return AuFnv1aPtr(str, length);
}
inline AuUInt32 AuFnv1a32Runtime(const void *base, AuUInt length) noexcept
{
AuUInt32 result {kFnv1MagicVal32};