outsource hash function

This commit is contained in:
juhnsa committed 2025-08-26 16:14:10 +02:00
1 parent a64c72d4fc
commit b01b0d4eb5
2 files changed
+8 -8

No files matched your search

+7
View File
@@ -0,0 +1,7 @@
function hash(str)
local hash = 0
for i = 1, #str do
hash = (hash * 31 + string.byte(str, i)) % 65536
end
return string.format("%04X", hash)
end