function Base64.Encode(u,l)local V={}local p=0 for u=1,#l,3 do local n,h,T=string.byte(l,u,u+2)local N=bit32_rshift(n,2)local Y=bit32_lshift(bit32_band(n,3),4)+bit32_rshift(h or 0,4)local d=bit32_lshift(bit32_band(h or 0,15),2)+bit32_rshift(T or 0,6)local J=bit32_band(T or 0,63)V[p+1]=Alphabet[N+1]V[p+2]=Alphabet[Y+1]V[p+3]=h and Alphabet[d+1]or 61 V[p+4]=T and Alphabet[J+1]or 61 p=p+4 end local n={}local h=0 for l=1,p,4096 do h=h+1 n[h]=string.char(table.unpack(V,l,math.min((l+4096)-1,p)))end return table.concat(n)end
--[[**
	Encodes a string in Base64.
	@param [string] Input The input string to encode.
	@returns [string] The string encoded in Base64.
**--]]
function Base64:Encode(Input)
	local Output = {}
	local Length = 0

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

		local A = bit32_rshift(C1, 2)
		local B = bit32_lshift(bit32_band(C1, 3), 4) + bit32_rshift(C2 or 0, 4)
		local C = bit32_lshift(bit32_band(C2 or 0, 15), 2) + bit32_rshift(C3 or 0, 6)
		local D = bit32_band(C3 or 0, 63)

		Output[Length + 1] = Alphabet[A + 1]
		Output[Length + 2] = Alphabet[B + 1]
		Output[Length + 3] = C2 and Alphabet[C + 1] or 61
		Output[Length + 4] = C3 and Alphabet[D + 1] or 61
		Length = Length + 4
	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
