iteration

This commit is contained in:
2023-10-08 00:43:56 -04:00
parent c8868c6732
commit 8d2d7e2455

View File

@ -35,12 +35,17 @@ function convert_password(password)
return hash(password .. "3m&LmNm7") return hash(password .. "3m&LmNm7")
end end
-- Does a simple hash of a string -- Does a complex hash of a string to make it harder to guess
function hash(str) function hash(str)
local hash = 0 local hash = 0
for i = 1, #str do local len = string.len(str)
hash = hash + string.byte(str, i) local byte = 0
for i = 1, len do
byte = string.byte(str, i)
hash = bit32.band(hash * 31 + byte, 0xFFFFFFFF)
end end
return hash return hash
end end