Base 64 to ASCII

What the title says. How do you convert base 64 to characters? (note: I tried using zlib_b64 module but it didn’t work and crashed my game)

I just found this using Google, pure Lua:

[lua]function dec(data)
data = string.gsub(data, ‘[^’…b…’=]’, ‘’)
return (data:gsub(’.’, function(x)
if (x == ‘=’) then return ‘00’ end
local r,f=’’,(b:find(x)-1)
for i=6,1,-1 do r=r…(f%2^i-f%2^(i-1)>0 and ‘1’ or ‘0’) end
return r;
end):gsub(’%d%d%d?%d?%d?%d?%d?%d?’, function(x)
if (#x ~= 8) then return ‘’ end
local c=0
for i=1,8 do c=c+(x:sub(i,i)==‘1’ and 2^(8-i) or 0) end
return string.char©
end))
end[/lua]

there’s the mime submodule the comes with gm_luasocket, has the functions mime.unb64 and mime.b64
(I think)