b64/README.md
Kalle Carlbark 45523d1292
docs: Add README
While here, clean up and s/zb64/b64/g
2023-08-30 22:42:01 +02:00

977 B

b64

Is a tool I created to

  • Quickly encode and decode base64
  • 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