aboutsummaryrefslogtreecommitdiff
path: root/src/common.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common.cpp')
-rw-r--r--src/common.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/common.cpp b/src/common.cpp
index 6a53332d9..e0a579c5d 100644
--- a/src/common.cpp
+++ b/src/common.cpp
@@ -364,6 +364,14 @@ gb_internal String obfuscate_string(String const &s, char const *prefix) {
return make_string_c(res);
}
+gb_internal i32 obfuscate_i32(i32 i) {
+ i32 x = cast(i32)gb_fnv64a(&i, sizeof(i));
+ if (x < 0) {
+ x = 1-x;
+ }
+ return cast(i32)x;
+}
+
struct StringIntern {