https://github.com/bahaaio/base64-cli
A minimal and efficient Base64 encoder/decoder CLI tool written in C++.
https://github.com/bahaaio/base64-cli
base64 cli cpp decoding encoding lightweight utility
Last synced: 10 months ago
JSON representation
A minimal and efficient Base64 encoder/decoder CLI tool written in C++.
- Host: GitHub
- URL: https://github.com/bahaaio/base64-cli
- Owner: Bahaaio
- License: mit
- Created: 2025-07-06T12:47:54.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-07-06T13:37:58.000Z (12 months ago)
- Last Synced: 2025-08-09T15:20:43.393Z (11 months ago)
- Topics: base64, cli, cpp, decoding, encoding, lightweight, utility
- Language: C++
- Homepage:
- Size: 4.88 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐งฌ base64-cli
A minimal and efficient Base64 encoder/decoder written in C++.
Supports file input/output, piped stdin, and argument input.
> ๐ง No dependencies. Cross-platform. Fast. Ideal for quick scripts or lightweight CLI usage.
## โจ Features
- ๐ Encode or decode Base64
- ๐ Input from file, argument, or `stdin`
- ๐ค Output to file or `stdout`
- ๐ซ Graceful error handling
- ๐งช Useful for piping, scripting, and quick testing
## ๐ Examples
### ๐ค Encode a string
```bash
./base64 "hello"
# โ aGVsbG8=
```
### ๐ Encode a file
```bash
./base64 -i hello.txt
```
### ๐งช Pipe input via stdin
```bash
echo -n "hello" | ./base64
```
### ๐ Decode from file to binary output
```bash
./base64 -d -i encoded.txt -o image.png
```
### โ Show help
```bash
./base64 --help
```
## ๐ ๏ธ Build
### Using CMake
```bash
cmake -B build
cd build
cmake --build .
./base64 "hello"
```
### Or manually
```bash
g++ -std=c++17 -O2 -o base64 ./src/main.cpp
```
## ๐ฆ Usage
```bash
base64 [options] [input...]
```
### Options
| Option | Description |
| ---------------- | ---------------------- |
| `-e`, `--encode` | Encode input (default) |
| `-d`, `--decode` | Decode input |
| `-i ` | Read input from file |
| `-o ` | Write output to file |
| `-h`, `--help` | Show help message |
## ๐ License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.