No description
Find a file
2023-08-31 22:40:56 +02:00
src fix: Write to stdout instead of stderr 2023-08-31 22:40:56 +02:00
.gitignore chore: Add zb64 2023-08-27 16:24:14 +02:00
build.zig fix: Write to stdout instead of stderr 2023-08-31 22:40:56 +02:00
build.zig.zon fix: Write to stdout instead of stderr 2023-08-31 22:40:56 +02:00
README.md docs: Grammar 2023-08-30 22:50:50 +02:00

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