You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function base64.decode( b64, decoder, usecaching )
decoder = decoder or DEFAULT_DECODER
local pattern = '[^%w%+%/%=]'
local spad = string.byte('=')
if decoder then
local s62, s63
for charcode, b64code in pairs( decoder ) do
if b64code == 62 then s62 = charcode
elseif b64code == 63 then s63 = charcode
elseif b64code == 64 then spad = charcode
end
end
pattern = ('[^%%w%%%s%%%s%%%s]'):format( char(s62), char(s63), char(spad) )
end
b64 = b64:gsub( pattern, '' )
local cache = usecaching and {}
local t, k = {}, 1
local n = #b64
local padding = b64:sub(-2) == char(spad):rep(2) and 2 or b64:sub(-1) == char(spad) and 1 or 0
for i = 1, padding > 0 and n-4 or n, 4 do
local a, b, c, d = b64:byte( i, i+3 )
local s
In
base64.lua
infunction base64.decode
These should be replaced with spad in both cases, with proper escapeing
The text was updated successfully, but these errors were encountered: