function Base64.Decode(g)local R={}local Z=0 for j=1,#g,4 do local O,w,h,U=string.byte(g,j,j+3)local i=Indexes[O]-1 local k=Indexes[w]-1 local Y=(Indexes[h]or 1)-1 local p=(Indexes[U]or 1)-1 local P=bit32_lshift(i,2)+bit32_rshift(k,4)local n=bit32_lshift(bit32_band(k,15),4)+bit32_rshift(Y,2)local A=bit32_lshift(bit32_band(Y,3),6)+p Z=Z+1 R[Z]=P if h~=61 then Z=Z+1 R[Z]=n end if U~=61 then Z=Z+1 R[Z]=A end end local j={}local O=0 local w for g=1,Z,4096 do O=O+1 w=(g+4096)-1 j[O]=string.char(table.unpack(R,g,w>Z and Z or w))end return table.concat(j)end return Base64
--[[**
	Decodes a string from Base64.
	@param [t:string] Input The input string to decode.
	@returns [t: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
	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
