From 68cf9de1046450a41601c9e8555cdb73fe950f19 Mon Sep 17 00:00:00 2001 From: Reece Date: Tue, 24 May 2022 09:59:50 +0100 Subject: [PATCH] [+] AuFnv1aPtr and AuFnv1a(str, len) --- Include/auROXTL/auFNV1Utils.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Include/auROXTL/auFNV1Utils.hpp b/Include/auROXTL/auFNV1Utils.hpp index 474d9a8..48a3707 100644 --- a/Include/auROXTL/auFNV1Utils.hpp +++ b/Include/auROXTL/auFNV1Utils.hpp @@ -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 +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};