From 0b61b577f5d65a9c8bd5e690c4010c1e28b70e66 Mon Sep 17 00:00:00 2001 From: Diego Nehab Date: Tue, 20 Jan 2004 22:21:50 +0000 Subject: [PATCH] Just performs b64 encoding of stdin to stdout. --- etc/b64.lua | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 etc/b64.lua diff --git a/etc/b64.lua b/etc/b64.lua new file mode 100644 index 0000000..7a4607d --- /dev/null +++ b/etc/b64.lua @@ -0,0 +1,8 @@ +local base64 = socket.mime.base64.encode() +local split = socket.mime.split() +local convert = socket.mime.chain(base64, split) +while 1 do + local chunk = io.read(4096) + io.write(convert(chunk)) + if not chunk then break end +end