5e6b4428bb
Windows has no base64 command; certutil is file-only, adds PEM markers and cannot be piped. This is a real base64.exe matching GNU coreutils: same flags (-d, -i, -w), stdin/stdout streaming, exit codes and error messages, so existing muscle memory and scripts carry over. Verified against coreutils 9.7 with a 153-case differential test. The subtle behaviours are reproduced: bytes are emitted incrementally so a stream that goes bad still writes its valid prefix, unpadded tails are accepted only when canonically encoded, concatenated streams decode as one, and -w0 suppresses the trailing newline. Deliberate deviation: '\r' is skipped when decoding alongside '\n', as CRLF base64 files are routine on Windows and GNU rejects them. Zero dependencies, so the build works offline.
17 lines
196 B
TOML
17 lines
196 B
TOML
[package]
|
|
name = "base64"
|
|
version = "1.0.0"
|
|
edition = "2021"
|
|
|
|
[dependencies]
|
|
|
|
[[bin]]
|
|
name = "base64"
|
|
path = "src/main.rs"
|
|
|
|
[profile.release]
|
|
opt-level = 3
|
|
lto = true
|
|
strip = true
|
|
panic = "abort"
|