Base64 decoding function is operational
This commit is contained in:
parent
a86b6711bb
commit
1ff3867733
7
b64.lua
7
b64.lua
@ -3,6 +3,9 @@
|
||||
-- compatible with lua 5.1
|
||||
-- http://www.it-rfc.de
|
||||
-- licensed under the terms of the LGPL2
|
||||
--module('b64', package.seeall)
|
||||
|
||||
b64 = {}
|
||||
|
||||
-- bitshift functions (<<, >> equivalent)
|
||||
-- shift left
|
||||
@ -42,7 +45,7 @@ end
|
||||
|
||||
-- function decode
|
||||
-- decode base64 input to string
|
||||
function decode(data)
|
||||
function b64.decode(data)
|
||||
local chars = {}
|
||||
local result=""
|
||||
for dpos=0,string.len(data)-1,4 do
|
||||
@ -60,4 +63,4 @@ function decode(data)
|
||||
return result
|
||||
end
|
||||
|
||||
module('b64',package.seeall)
|
||||
return b64
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user