aboutsummaryrefslogtreecommitdiff
path: root/zencore/include
diff options
context:
space:
mode:
Diffstat (limited to 'zencore/include')
-rw-r--r--zencore/include/zencore/string.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/zencore/include/zencore/string.h b/zencore/include/zencore/string.h
index d7727ca08..684e27827 100644
--- a/zencore/include/zencore/string.h
+++ b/zencore/include/zencore/string.h
@@ -590,6 +590,21 @@ ParseInt(const std::string_view& Input)
//////////////////////////////////////////////////////////////////////////
+constexpr uint32_t
+HashStringDjb2(const std::string_view& InString)
+{
+ uint32_t HashValue = 5381;
+
+ for (int c : InString)
+ {
+ HashValue = HashValue * 33 + c;
+ }
+
+ return HashValue;
+}
+
+//////////////////////////////////////////////////////////////////////////
+
void string_forcelink(); // internal
} // namespace zen