diff options
author | Caleb Maclennan <caleb@alerque.com> | 2023-11-10 09:12:04 +0300 |
---|---|---|
committer | Caleb Maclennan <caleb@alerque.com> | 2023-11-10 09:12:04 +0300 |
commit | 5c4fc93d5f4137bf4c22ddf1a048c907a4a26727 (patch) | |
tree | a9a68e1f6a9c3bfe2b64fa1c3a4098865b7d3b5d /etc/b64.lua | |
parent | ccef3bc4e2aa6ee5b997a80aabb58f4ff0b0e98f (diff) | |
parent | 43a97b7f0053313b43906371dbdc226271e6c8ab (diff) | |
download | luasocket-hjelmeland-patch-1.tar.gz luasocket-hjelmeland-patch-1.tar.bz2 luasocket-hjelmeland-patch-1.zip |
Merge branch 'master' into hjelmeland-patch-1hjelmeland-patch-1
Diffstat (limited to 'etc/b64.lua')
-rw-r--r-- | etc/b64.lua | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/etc/b64.lua b/etc/b64.lua deleted file mode 100644 index 11eeb2d..0000000 --- a/etc/b64.lua +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | ----------------------------------------------------------------------------- | ||
2 | -- Little program to convert to and from Base64 | ||
3 | -- LuaSocket sample files | ||
4 | -- Author: Diego Nehab | ||
5 | ----------------------------------------------------------------------------- | ||
6 | local ltn12 = require("ltn12") | ||
7 | local mime = require("mime") | ||
8 | local source = ltn12.source.file(io.stdin) | ||
9 | local sink = ltn12.sink.file(io.stdout) | ||
10 | local convert | ||
11 | if arg and arg[1] == '-d' then | ||
12 | convert = mime.decode("base64") | ||
13 | else | ||
14 | local base64 = mime.encode("base64") | ||
15 | local wrap = mime.wrap() | ||
16 | convert = ltn12.filter.chain(base64, wrap) | ||
17 | end | ||
18 | sink = ltn12.sink.chain(convert, sink) | ||
19 | ltn12.pump.all(source, sink) | ||