function Base64.Decode(U,q)local Q={}local T=0 for U=1,#q,4 do local R,D,L,Z=string.byte(q,U,U+3)local e=Indexes[R]-1 local J=Indexes[D]-1 local a=(Indexes[L]or 1)-1 local S=(Indexes[Z]or 1)-1 local x=bit32_lshift(e,2)+bit32_rshift(J,4)local Y=bit32_lshift(bit32_band(J,15),4)+bit32_rshift(a,2)local f=bit32_lshift(bit32_band(a,3),6)+S T=T+1 Q[T]=x if L~=61 then T=T+1 Q[T]=Y end if Z~=61 then T=T+1 Q[T]=f end end local R={}local D=0 for q=1,T,4096 do D=D+1 R[D]=string.char(table.unpack(Q,q,math.min((q+4096)-1,T)))end return table.concat(R)end return Base64
--[[**
	Decodes a string from Base64.
	@param [string] Input The input string to decode.
	@returns [string] The newly decoded string.
**--]]
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

	for Index = 1, Length, 4096 do
		NewLength = NewLength + 1
		NewOutput[NewLength] = string.char(table.unpack(Output, Index, math.min(Index + 4096 - 1, Length)))
	end

	return table.concat(NewOutput)
end

return Base64
