mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-13 06:43:35 +00:00
Obfuscate #file and #procedure when -obfuscate-source-code-locations is enabled
This commit is contained in:
@@ -353,6 +353,19 @@ gb_global bool global_module_path_set = false;
|
||||
#include "thread_pool.cpp"
|
||||
|
||||
|
||||
gb_internal String obfuscate_string(String const &s, char const *prefix) {
|
||||
if (s.len == 0) {
|
||||
return {};
|
||||
}
|
||||
GB_ASSERT(prefix != nullptr);
|
||||
u64 hash = gb_fnv64a(s.text, s.len);
|
||||
gbString res = gb_string_make(temporary_allocator(), prefix);
|
||||
res = gb_string_append_fmt(res, "x%llx", cast(long long unsigned)hash);
|
||||
return make_string_c(res);
|
||||
}
|
||||
|
||||
|
||||
|
||||
struct StringIntern {
|
||||
StringIntern *next;
|
||||
isize len;
|
||||
|
||||
Reference in New Issue
Block a user