refactor tbl2number

This commit is contained in:
kikito 2015-04-06 17:24:46 +02:00
parent a08ab4f93d
commit 332517912d

11
md5.lua

@ -56,16 +56,13 @@ if ok then
else else
local function tbl2number(tbl) local function tbl2number(tbl)
local n = #tbl local result = 0
local rslt = 0
local power = 1 local power = 1
for i = 1, n do for i = 1, #tbl do
rslt = rslt + tbl[i]*power result = result + tbl[i] * power
power = power * 2 power = power * 2
end end
return result
return rslt
end end
local function expand(t1, t2) local function expand(t1, t2)