replaced toint with a shorter version
This commit is contained in:
parent
a82ce51d05
commit
f5262fad08
@ -11,15 +11,11 @@ local function cint(n,l)
|
||||
return string.reverse(string.char(table.unpack(t)):sub(1,l))
|
||||
end
|
||||
local function toint(s)
|
||||
s=s or ""
|
||||
local n = 0
|
||||
local i = 1
|
||||
while true do
|
||||
local p = s:sub(i,i)
|
||||
if p == "" then break end
|
||||
local b = string.byte(p)
|
||||
for p in s:gmatch(".") do
|
||||
n = n << 8
|
||||
n = n | b
|
||||
n = n | string.byte(p)
|
||||
i=i+1
|
||||
end
|
||||
return n
|
||||
|
Loading…
Reference in New Issue
Block a user