luasocket/etc/b64.lua
Diego Nehab bcc0c2a9f0 New filter scheme.
ltn12 and mime updated.
smtp/ftp broken.
2004-03-16 06:42:53 +00:00

13 lines
360 B
Lua

local source = ltn12.source.file(io.stdin)
local sink = ltn12.sink.file(io.stdout)
local convert
if arg and arg[1] == '-d' then
convert = mime.decode("base64")
else
local base64 = mime.encode("base64")
local wrap = mime.wrap()
convert = ltn12.filter.chain(base64, wrap)
end
source = ltn12.source.chain(source, convert)
ltn12.pump(source, sink)