/// Base64 encode or decode FILE (or standard input), to standard output. #[derive(Debug, Parser)] struct Opt { /// Decode the base64-encoded input (default: encode the input as base64). #[structopt(short = 'd', long = "decode")]
decode: bool,
/// The encoding alphabet: "standard" (default) or "url-safe". #[structopt(long = "alphabet")]
alphabet: Option<Alphabet>,
/// Omit padding characters while encoding, and reject them while decoding. #[structopt(short = 'p', long = "no-padding")]
no_padding: bool,
/// The file to encode or decode. #[structopt(name = "FILE", parse(from_os_str))]
file: Option<PathBuf>,
}
let alphabet = opt.alphabet.unwrap_or_default(); let engine = engine::GeneralPurpose::new(
&match alphabet {
Alphabet::Standard => alphabet::STANDARD,
Alphabet::UrlSafe => alphabet::URL_SAFE,
}, match opt.no_padding { true => engine::general_purpose::NO_PAD, false => engine::general_purpose::PAD,
},
);
let stdout = io::stdout(); letmut stdout = stdout.lock(); let r = if opt.decode { letmut decoder = read::DecoderReader::new(&mut input, &engine);
io::copy(&mut decoder, &mut stdout)
} else { letmut encoder = write::EncoderWriter::new(&mut stdout, &engine);
io::copy(&mut input, &mut encoder)
}; iflet Err(e) = r {
eprintln!( "Base64 {} failed with {}", if opt.decode { "decode" } else { "encode" },
e
);
process::exit(1);
}
}
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.1Bemerkung:
(vorverarbeitet am 2026-09-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.