Update Rust crate base64 to v0.21.4
This MR contains the following updates:
| Package | Type | Update | Change | 
|---|---|---|---|
| base64 | dependencies | minor | 0.13->0.21 | 
| base64 | dependencies | minor | 0.13.1->0.21.4 | 
Release Notes
marshallpierce/rust-base64 (base64)
v0.21.4
- Make encoded_lenconst, allowing the creation of arrays sized to encode compile-time-known data lengths
v0.21.3
- Implement sourceinstead ofcauseon Error types
- Roll back MSRV to 1.48.0 so Debian can continue to live in a time warp
- Slightly faster chunked encoding for short inputs
- Decrease binary size
v0.21.2
- Rollback MSRV to 1.57.0 -- only dev dependencies need 1.60, not the main code
v0.21.1
- Remove the possibility of panicking during decoded length calculations
- 
DecoderReaderno longer sometimes erroneously ignores padding #226
Breaking changes
- 
Engine.internal_decodereturn type changed
- Update MSRV to 1.60.0
v0.21.0
Migration
Functions
| < 0.20 function | 0.21 equivalent | 
|---|---|
| encode() | engine::general_purpose::STANDARD.encode()orprelude::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()orprelude::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.
Padding
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 | 
v0.20.0
Breaking changes
- Update MSRV to 1.57.0
- Decoding can now either ignore padding, require correct padding, or require no padding. The default is to require
correct padding.
- The NO_PADconfig now requires that padding be absent when decoding.
 
- The 
0.20.0-alpha.1
Breaking changes
- Extended the Configconcept into theEngineabstraction, allowing the user to pick different encoding / decoding implementations.- What was formerly the only algorithm is now the FastPortableengine, so named because it's portable (works on any CPU) and relatively fast.
- This opens the door to a portable constant-time
implementation (#153,
presumably ConstantTimePortable?) for security-sensitive applications that need side-channel resistance, and CPU-specific SIMD implementations for more speed.
- Standard base64 per the RFC is available via DEFAULT_ENGINE. To use different alphabets or other settings ( padding, etc), create your own engine instance.
 
- What was formerly the only algorithm is now the 
- 
CharacterSetis nowAlphabet(per the RFC), and allows creating custom alphabets. The corresponding tables that were previously code-generated are now built dynamically.
- Since there are already multiple breaking changes, various functions are renamed to be more consistent and discoverable.
- MSRV is now 1.47.0 to allow various things to use const fn.
- 
DecoderReadernow owns its inner reader, and can expose it viainto_inner(). For symmetry,EncoderWritercan do the same with its writer.
- 
encoded_lenis now public so you can size encode buffers precisely.
v0.13.1
- More precise decode buffer sizing, avoiding unnecessary allocation in decode_config.
Configuration
- 
If you want to rebase/retry this MR, check this box 
This MR has been generated by Renovate Bot.