base64 Docs CircleCI codecov unsafe forbiddenMade with CL... | base64 Docs CircleCI codecov unsafe forbiddenMade with CL...
base64
Docs CircleCI codecov unsafe forbidden



Made with CLion. Thanks to JetBrains for supporting open source!

It's base64. What more could anyone want?

This library's goals are to be correct and fast. It's thoroughly tested and widely used. It exposes functionality at multiple levels of abstraction so you can choose the level of convenience vs performance that you want, e.g. decode_engine_slice decodes into an existing &mut [u8] and is pretty fast (2.6GiB/s for a 3 KiB input), whereas decode_engine allocates a new Vec<u8> and returns it, which might be more convenient in some cases, but is slower (although still fast enough for almost any purpose) at 2.1 GiB/s.

See the docs for all the details.

FAQ
I need to decode base64 with whitespace/null bytes/other random things interspersed in it. What should I do?
Remove non-base64 characters from your input before decoding.

If you have a Vec of base64, retain can be used to strip out whatever you need removed.

If you have a Read (e.g. reading a file or network socket), there are various approaches.

Use iter_read together with Read's bytes() to filter out unwanted bytes.
Implement Read with a read() impl that delegates to your actual Read, and then drops any bytes you don't want.
I need to line-wrap base64, e.g. for MIME/PEM.
line-wrap does just that.
https://crates.io/crates/base64 crates.io: Rust Package Registry