outsource hash function
This commit is contained in:
1 parent
a64c72d4fc
commit
b01b0d4eb5
2 files changed
+8
-8
No files matched your search
@@ -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
|
||||||
@@ -13,14 +13,7 @@ local function split(str, divider)
|
|||||||
return t
|
return t
|
||||||
end
|
end
|
||||||
|
|
||||||
local function hash(str)
|
dofile(dir..'hash.lua')
|
||||||
local hash = 0
|
|
||||||
for i = 1, #str do
|
|
||||||
hash = (hash * 31 + string.byte(str, i)) % 65536
|
|
||||||
end
|
|
||||||
return string.format("%04X", hash)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local function check_for_outdated_sessions()
|
local function check_for_outdated_sessions()
|
||||||
local expired = 0
|
local expired = 0
|
||||||
|
|||||||
Reference in new issue
Block a user