diff options
author | Shauren <shauren.trinity@gmail.com> | 2023-11-21 12:25:22 +0100 |
---|---|---|
committer | funjoker <funjoker109@gmail.com> | 2023-12-01 23:28:35 +0100 |
commit | 070cd23b6cf2e985713b90455cb7f7c53535cbcf (patch) | |
tree | cfcd414ecc4d3ef05253140ce83897f693d6dcd3 /src/common/Utilities/Hash.h | |
parent | b6e346eaf0ee9a1c0dc2c7977ac950b77c857ecf (diff) |
Core/Calendar: Implement different timezone support for ingame calendar
Closes #8390
Closes #29427
(cherry picked from commit b888b1b09f71a8b8b4a9d45c804a1f164fb65ac3)
Diffstat (limited to 'src/common/Utilities/Hash.h')
-rw-r--r-- | src/common/Utilities/Hash.h | 12 |
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 |