1,018 B
1,018 B
b64
A tool I created to
- Base64 encode/decode text quickly from helix :)
- Learn a bit of Zig
Usage
Usage: b64 [-e] [-d] <string>
-h, --help
Display this help and exit.
-d, --decode
Decode base64 to string.
-e, --encode
Encode string to base64.
-v, --version
Display version.
<str>
String to encode or decode.
Encoding
$ b64 -e "encode this string to base64"
ZW5jb2RlIHRoaXMgc3RyaW5nIHRvIGJhc2U2NA==
# From stdin
$ echo -n "encode this string to base64" | b64 -e
ZW5jb2RlIHRoaXMgc3RyaW5nIHRvIGJhc2U2NA==
$
Decoding
$ b64 -d ZW5jb2RlIHRoaXMgc3RyaW5nIHRvIGJhc2U2NA==
encode this string to base64
# From stdin
$ echo -n "ZW5jb2RlIHRoaXMgc3RyaW5nIHRvIGJhc2U2NA==" | b64 -d
encode this string to base64
$
Build
$ git clone https://git.kcbark.net/zig/b64.git && cd b64
$ zig build -Doptimize=ReleaseFast
$ cp zig-out/bin/b64 ~/.local/bin