function Base64.Decode(V)local U={}local f=0 for g=1,#V,4 do local E,j,k,b=string.byte(V,g,g+3)local Q=Indexes[E]-1 local N=Indexes[j]-1 local T=(Indexes[k]or 1)-1 local B=(Indexes[b]or 1)-1 local y=bit32_lshift(Q,2)+bit32_rshift(N,4)local e=bit32_lshift(bit32_band(N,15),4)+bit32_rshift(T,2)local Z=bit32_lshift(bit32_band(T,3),6)+B f=f+1 U[f]=y if k~=61 then f=f+1 U[f]=e end if b~=61 then f=f+1 U[f]=Z end end local g={}local E=0 local j for V=1,f,4096 do E=E+1 j=(V+4096)-1 g[E]=string.char(table.unpack(U,V,j>f and f or j))end return table.concat(g)end return Base64

function Base64.Decode(Input)
	local Output = {}
	local Length = 0

	for Index = 1, #Input, 4 do
		local C1, C2, C3, C4 = string.byte(Input, Index, Index + 3)

		local I1 = Indexes[C1] - 1
		local I2 = Indexes[C2] - 1
		local I3 = (Indexes[C3] or 1) - 1
		local I4 = (Indexes[C4] or 1) - 1

		local A = bit32_lshift(I1, 2) + bit32_rshift(I2, 4)
		local B = bit32_lshift(bit32_band(I2, 15), 4) + bit32_rshift(I3, 2)
		local C = bit32_lshift(bit32_band(I3, 3), 6) + I4

		Length = Length + 1
		Output[Length] = A

		if C3 ~= 61 then
			Length = Length + 1
			Output[Length] = B
		end

		if C4 ~= 61 then
			Length = Length + 1
			Output[Length] = C
		end
	end

	local NewOutput = {}
	local NewLength = 0
	local IndexAdd4096Sub1

	for Index = 1, Length, 4096 do
		NewLength = NewLength + 1
		IndexAdd4096Sub1 = Index + 4096 - 1

		NewOutput[NewLength] = string.char(table.unpack(
			Output,
			Index,
			IndexAdd4096Sub1 > Length and Length or IndexAdd4096Sub1
		))
	end

	return table.concat(NewOutput)
end

return Base64
