aboutsummaryrefslogtreecommitdiff
path: root/src/common/Utilities/Hash.h
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2023-11-21 12:25:22 +0100
committerShauren <shauren.trinity@gmail.com>2023-11-21 12:25:22 +0100
commitb888b1b09f71a8b8b4a9d45c804a1f164fb65ac3 (patch)
treeba507c4c1c5e8487bd223afbde44ecf9eeac162e /src/common/Utilities/Hash.h
parent8c072b93af3a4efcbde21cc85fedcf7fa48fa7b4 (diff)
Core/Calendar: Implement different timezone support for ingame calendar
Closes #8390 Closes #29427
Diffstat (limited to 'src/common/Utilities/Hash.h')
-rw-r--r--src/common/Utilities/Hash.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/common/Utilities/Hash.h b/src/common/Utilities/Hash.h
index b63201bf07a..18f7442fb44 100644
--- a/src/common/Utilities/Hash.h
+++ b/src/common/Utilities/Hash.h
@@ -19,6 +19,7 @@
#define TrinityCore_Hash_h__
#include <functional>
+#include <string_view>
#include <utility>
namespace Trinity
@@ -28,6 +29,17 @@ namespace Trinity
{
seed ^= std::hash<T>()(val) + 0x9E3779B9 + (seed << 6) + (seed >> 2);
}
+
+ inline std::uint32_t HashFnv1a(std::string_view data)
+ {
+ std::uint32_t hash = 0x811C9DC5u;
+ for (char c : data)
+ {
+ hash ^= c;
+ hash *= 0x1000193u;
+ }
+ return hash;
+ }
}
//! Hash implementation for std::pair to allow using pairs in unordered_set or as key for unordered_map