NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #10 most downloaded on crates.io
encodes and decodes base64 as bytes or utf8
Last release 2 months ago
04 Aug 2026
Ships unpredictably
gaps range from 9 days to 2.2 years
Most releases are documented
notes for 34 of 41 stable releases
Nothing withdrawn
no release was ever pulled
11 years old
45 releases · first in 2015
Make the tests build again on non-SIMD architectures
Added more consts for preconfigured configs and engines
simd-unsafe feature: Simd picks the best
instruction set at runtime (AVX2 on x86_64, NEON on aarch64) and falls back to the scalar
GeneralPurpose engine, while Avx2 and Neon target one instruction set with no runtime
detection and work in no_std. The engines support the standard and URL-safe alphabets.One column per quarter.
Correct the symbols used for the predefined alphabet::BIN_HEX.
alphabet::BIN_HEX.DecodeSliceError::OutputSliceTooSmall is now conservative rather than precise. That is, the error will only occur if the decoded output _cannot_ fit,
DecodeSliceError::OutputSliceTooSmall is now conservative rather than precise. That is, the error will only occur if the decoded output cannot fit, meaning that Engine::decode_slice can now be used with exactly-sized output slices. As part of this, Engine::internal_decode now returns DecodeSliceError instead of DecodeError, but that is not expected to affect any external callers.DecodeError::InvalidLength now refers specifically to the number of valid symbols being invalid (i.e. len % 4 == 1), rather than just the number of input bytes. This avoids confusing scenarios when based on interpretation you could make a case for either InvalidLength or InvalidByte being appropriate.Support getting an alphabet's contents as a str via Alphabet::as_str()
Alphabet::as_str()Improved introductory documentation and example
Add Debug and Clone impls for the general purpose Engine
Debug and Clone impls for the general purpose EngineMake encoded_len const, allowing the creation of arrays sized to encode compile-time-known data lengths
encoded_len const, allowing the creation of arrays sized to encode compile-time-known data lengthsImplement source instead of cause on Error types
source instead of cause on Error typesRollback MSRV to 1.57.0 -- only dev dependencies need 1.60, not the main code
Remove the possibility of panicking during decoded length calculations
DecoderReader no longer sometimes erroneously ignores
padding #226Engine.internal_decode return type changed| < 0.20 function | 0.21 equivalent |
| < 0.20 function | 0.21 equivalent |
|---|---|
encode() |
engine::general_purpose::STANDARD.encode() or prelude::BASE64_STANDARD.encode() |
encode_config() |
engine.encode() |
encode_config_buf() |
engine.encode_string() |
encode_config_slice() |
engine.encode_slice() |
decode() |
engine::general_purpose::STANDARD.decode() or prelude::BASE64_STANDARD.decode() |
decode_config() |
engine.decode() |
decode_config_buf() |
engine.decode_vec() |
decode_config_slice() |
engine.decode_slice() |
The short-lived 0.20 functions were the 0.13 functions with config replaced with engine.
If applicable, use the preset engines engine::STANDARD, engine::STANDARD_NO_PAD, engine::URL_SAFE,
or engine::URL_SAFE_NO_PAD.
The NO_PAD ones require that padding is absent when decoding, and the others require that
canonical padding is present .
If you need the < 0.20 behavior that did not care about padding, or want to recreate < 0.20.0's predefined Configs
precisely, see the following table.
| 0.13.1 Config | 0.20.0+ alphabet | encode_padding |
decode_padding_mode |
|---|---|---|---|
| STANDARD | STANDARD | true | Indifferent |
| STANDARD_NO_PAD | STANDARD | false | Indifferent |
| URL_SAFE | URL_SAFE | true | Indifferent |
| URL_SAFE_NO_PAD | URL_SAFE | false | Indifferent |
Restore the ability to decode into a slice of precisely the correct length with Engine.decode_slice_unchecked.
Engine.decode_slice_unchecked.Engine as a pub use in prelude.Re-exports of preconfigured engines in engine are removed in favor of base64::... that are better suited to those who wish to use the entire path to a
engine are removed in favor of base64::prelude::... that are better suited
to those who wish to use the entire path to a name.FastPortable was only meant to be an interim name, and shouldn't have shipped in 0.20. It is now GeneralPurpose to make its intended usage more clear.
FastPortable was only meant to be an interim name, and shouldn't have shipped in 0.20. It is now GeneralPurpose to
make its intended usage more clear.GeneralPurpose and its config are now pub use'd in the engine module for convenience.from() functions to be new(). from() causes confusing compiler errors because of confusion
with From::from, and is a little misleading because some of those invocations are not very cheap as one would
usually expect from a from call.encode* and decode* top level functions are now methods on Engine.DEFAULT_ENGINE was replaced by engine::general_purpose::STANDARDengine::general_purpose::{STANDARD, STANDARD_NO_PAD, URL_SAFE, URL_SAFE_NO_PAD}
pub used into engine as well*_slice decode/encode functions now return an error instead of panicking when the output slice is too small
decoded_len_estimate() is provided to make it easy to size decode buffers correctly.Since there are already multiple breaking changes, various functions are renamed to be more consistent and discoverable.
NO_PAD config now requires that padding be absent when decoding.Config concept into the Engine abstraction, allowing the user to pick different encoding / decoding
implementations.
FastPortable engine, so named because it's portable (works on
any CPU) and relatively fast.ConstantTimePortable?) for security-sensitive applications that need side-channel resistance, and
CPU-specific SIMD implementations for more speed.DEFAULT_ENGINE. To use different alphabets or other settings (
padding, etc), create your own engine instance.CharacterSet is now Alphabet (per the RFC), and allows creating custom alphabets. The corresponding tables that
were previously code-generated are now built dynamically.const fn.DecoderReader now owns its inner reader, and can expose it via into_inner(). For symmetry, EncoderWriter can do
the same with its writer.encoded_len is now public so you can size encode buffers precisely.Nothing published for this version
More precise decode buffer sizing, avoiding unnecessary allocation in decode_config.
decode_config.Added EncoderStringWriter to allow encoding directly to a String
EncoderStringWriter to allow encoding directly to a StringEncoderWriter now owns its delegate writer rather than keeping a reference to it (though refs still work)
EncoderWriter via finish(), which
returns Result<W> instead of Result<()>. If you were calling finish() explicitly, you will now need to
use let _ = foo.finish() instead of just foo.finish() to avoid a warning about the unused value.InvalidByte will be
emitted instead of InvalidLength to make the problem more obvious.Nothing published for this version
- Add BinHex alphabet
BinHex alphabet- Add Bcrypt alphabet
Bcrypt alphabetA Read implementation (DecoderReader) to let users transparently decoded data from a b64 input source
Read implementation (DecoderReader) to let users transparently decoded data from a b64 input sourceAsRef<[ut8]> for main encode*/decode* functionsno_std is now supported via the two new features alloc and std.
no_std is now supported via the two new features alloc and std.Fix bug in streaming encoding (#90): if the underlying writer didn't write all the bytes given to it, the remaining bytes would not be retried later.
EncoderWriter::write.Remove line wrapping. Line wrapping was never a great conceptual fit in this library, and other features (streaming encoding, etc) either couldn't sup
Base64Display creation no longer uses a Result because it can't fail, which means its helper methods for
common
configs that unwrap() for you are no longer neededWrite impl to transparently base64 as you write.unsafe code.no_std support. No out of the box configs use it, and it's trivial to do
yourself if needed: filter(|b| !b" \n\t\r\x0b\x0c".contains(b).- Update safemem
- Derive Clone for DecodeError.
Clone for DecodeError.Add support for crypt(3)'s base64 variant.
crypt(3)'s base64 variant.decode_config_slice function for no-allocation decoding, analogous to encode_config_slice
decode_config_slice function for no-allocation decoding, analogous to encode_config_sliceencode_config_slice function for no-allocation encoding
encode_config_slice function for no-allocation encodingBase64Display heap-free wrapper for use in format strings, etc
STANDARD_NO_PAD configBase64Display heap-free wrapper for use in format strings, etcDecode performance improvements
unsafe in fewer placesAvoid usize overflow when calculating length
Temporarily disable line wrapping
MIME support, including configurable line endings and line wrapping
decode_wsBase64Error to DecodeErrorNothing published for this version
Allow decoding a AsRef<[u8]> instead of just a &str
AsRef<[u8]> instead of just a &strEncode performance improvements
Nothing published for this version
Added encode/decode functions that do not allocate their own storage
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →