mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-03-06 00:28:45 +00:00
Add base64 decode to the IVR Menu.
This commit is contained in:
@@ -6,7 +6,7 @@ base64={}
|
||||
local b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
|
||||
|
||||
-- encoding
|
||||
function base64.enc(data)
|
||||
function base64.encode(data)
|
||||
return ((data:gsub('.', function(x)
|
||||
local r,b='',x:byte()
|
||||
for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end
|
||||
@@ -20,7 +20,7 @@ function base64.enc(data)
|
||||
end
|
||||
|
||||
-- decoding
|
||||
function base64.dec(data)
|
||||
function base64.decode(data)
|
||||
data = string.gsub(data, '[^'..b..'=]', '')
|
||||
return (data:gsub('.', function(x)
|
||||
if (x == '=') then return '' end
|
||||
|
||||
Reference in New Issue
Block a user