|
| 1 | +# 0.21.0 |
| 2 | + |
| 3 | +(not yet released) |
| 4 | + |
| 5 | + |
| 6 | +## Migration |
| 7 | + |
| 8 | +### Functions |
| 9 | + |
| 10 | +| < 0.20 function | 0.21 equivalent | |
| 11 | +|-------------------------|-------------------------------------------------------------------------------------| |
| 12 | +| `encode()` | `engine::general_purpose::STANDARD.encode()` or `prelude::BASE64_STANDARD.encode()` | |
| 13 | +| `encode_config()` | `engine.encode()` | |
| 14 | +| `encode_config_buf()` | `engine.encode_string()` | |
| 15 | +| `encode_config_slice()` | `engine.encode_slice()` | |
| 16 | +| `decode()` | `engine::general_purpose::STANDARD.decode()` or `prelude::BASE64_STANDARD.decode()` | |
| 17 | +| `decode_config()` | `engine.decode()` | |
| 18 | +| `decode_config_buf()` | `engine.decode_vec()` | |
| 19 | +| `decode_config_slice()` | `engine.decode_slice()` | |
| 20 | + |
| 21 | +The short-lived 0.20 functions were the 0.13 functions with `config` replaced with `engine`. |
| 22 | + |
| 23 | +### Padding |
| 24 | + |
| 25 | +If applicable, use the preset engines `engine::STANDARD`, `engine::STANDARD_NO_PAD`, `engine::URL_SAFE`, |
| 26 | +or `engine::URL_SAFE_NO_PAD`. |
| 27 | +The `NO_PAD` ones require that padding is absent when decoding, and the others require that |
| 28 | +canonical padding is present . |
| 29 | + |
| 30 | +If you need the < 0.20 behavior that did not care about padding, or want to recreate < 0.20.0's predefined `Config`s |
| 31 | +precisely, see the following table. |
| 32 | + |
| 33 | +| 0.13.1 Config | 0.20.0+ alphabet | `encode_padding` | `decode_padding_mode` | |
| 34 | +|-----------------|------------------|------------------|-----------------------| |
| 35 | +| STANDARD | STANDARD | true | Indifferent | |
| 36 | +| STANDARD_NO_PAD | STANDARD | false | Indifferent | |
| 37 | +| URL_SAFE | URL_SAFE | true | Indifferent | |
| 38 | +| URL_SAFE_NO_PAD | URL_SAFE | false | Indifferent | |
| 39 | + |
| 40 | +# 0.21.0-rc.1 |
| 41 | + |
| 42 | +- Restore the ability to decode into a slice of precisely the correct length with `Engine.decode_slice_unchecked`. |
| 43 | +- Add `Engine` as a `pub use` in `prelude`. |
| 44 | + |
| 45 | +# 0.21.0-beta.2 |
| 46 | + |
| 47 | +## Breaking changes |
| 48 | + |
| 49 | +- Re-exports of preconfigured engines in `engine` are removed in favor of `base64::prelude::...` that are better suited to those who wish to `use` the entire path to a name. |
| 50 | + |
| 51 | +# 0.21.0-beta.1 |
| 52 | + |
| 53 | +## Breaking changes |
| 54 | + |
| 55 | +- `FastPortable` was only meant to be an interim name, and shouldn't have shipped in 0.20. It is now `GeneralPurpose` to |
| 56 | + make its intended usage more clear. |
| 57 | +- `GeneralPurpose` and its config are now `pub use`'d in the `engine` module for convenience. |
| 58 | +- Change a few `from()` functions to be `new()`. `from()` causes confusing compiler errors because of confusion |
| 59 | + with `From::from`, and is a little misleading because some of those invocations are not very cheap as one would |
| 60 | + usually expect from a `from` call. |
| 61 | +- `encode*` and `decode*` top level functions are now methods on `Engine`. |
| 62 | +- `DEFAULT_ENGINE` was replaced by `engine::general_purpose::STANDARD` |
| 63 | +- Predefined engine consts `engine::general_purpose::{STANDARD, STANDARD_NO_PAD, URL_SAFE, URL_SAFE_NO_PAD}` |
| 64 | + - These are `pub use`d into `engine` as well |
| 65 | +- The `*_slice` decode/encode functions now return an error instead of panicking when the output slice is too small |
| 66 | + - As part of this, there isn't now a public way to decode into a slice _exactly_ the size needed for inputs that |
| 67 | + aren't multiples of 4 tokens. If adding up to 2 bytes to always be a multiple of 3 bytes for the decode buffer is |
| 68 | + a problem, file an issue. |
| 69 | + |
| 70 | +## Other changes |
| 71 | + |
| 72 | +- `decoded_len_estimate()` is provided to make it easy to size decode buffers correctly. |
| 73 | + |
1 | 74 | # 0.20.0
|
2 | 75 |
|
3 |
| -### Breaking changes |
| 76 | +## Breaking changes |
4 | 77 |
|
5 | 78 | - Update MSRV to 1.57.0
|
6 |
| -- Decoding can now either ignore padding, require correct padding, or require no padding. The default is to require correct padding. |
7 |
| - - The `NO_PAD` config now requires that padding be absent when decoding. |
| 79 | +- Decoding can now either ignore padding, require correct padding, or require no padding. The default is to require |
| 80 | + correct padding. |
| 81 | + - The `NO_PAD` config now requires that padding be absent when decoding. |
8 | 82 |
|
9 | 83 | ## 0.20.0-alpha.1
|
10 | 84 |
|
11 | 85 | ### Breaking changes
|
12 |
| -- Extended the `Config` concept into the `Engine` abstraction, allowing the user to pick different encoding / decoding implementations. |
13 |
| - - What was formerly the only algorithm is now the `FastPortable` engine, so named because it's portable (works on any CPU) and relatively fast. |
14 |
| - - This opens the door to a portable constant-time implementation ([#153](https://github.com/marshallpierce/rust-base64/pull/153), presumably `ConstantTimePortable`?) for security-sensitive applications that need side-channel resistance, and CPU-specific SIMD implementations for more speed. |
15 |
| - - Standard base64 per the RFC is available via `DEFAULT_ENGINE`. To use different alphabets or other settings (padding, etc), create your own engine instance. |
16 |
| -- `CharacterSet` is now `Alphabet` (per the RFC), and allows creating custom alphabets. The corresponding tables that were previously code-generated are now built dynamically. |
17 |
| -- Since there are already multiple breaking changes, various functions are renamed to be more consistent and discoverable. |
| 86 | + |
| 87 | +- Extended the `Config` concept into the `Engine` abstraction, allowing the user to pick different encoding / decoding |
| 88 | + implementations. |
| 89 | + - What was formerly the only algorithm is now the `FastPortable` engine, so named because it's portable (works on |
| 90 | + any CPU) and relatively fast. |
| 91 | + - This opens the door to a portable constant-time |
| 92 | + implementation ([#153](https://github.com/marshallpierce/rust-base64/pull/153), |
| 93 | + presumably `ConstantTimePortable`?) for security-sensitive applications that need side-channel resistance, and |
| 94 | + CPU-specific SIMD implementations for more speed. |
| 95 | + - Standard base64 per the RFC is available via `DEFAULT_ENGINE`. To use different alphabets or other settings ( |
| 96 | + padding, etc), create your own engine instance. |
| 97 | +- `CharacterSet` is now `Alphabet` (per the RFC), and allows creating custom alphabets. The corresponding tables that |
| 98 | + were previously code-generated are now built dynamically. |
| 99 | +- Since there are already multiple breaking changes, various functions are renamed to be more consistent and |
| 100 | + discoverable. |
18 | 101 | - MSRV is now 1.47.0 to allow various things to use `const fn`.
|
19 |
| -- `DecoderReader` now owns its inner reader, and can expose it via `into_inner()`. For symmetry, `EncoderWriter` can do the same with its writer. |
| 102 | +- `DecoderReader` now owns its inner reader, and can expose it via `into_inner()`. For symmetry, `EncoderWriter` can do |
| 103 | + the same with its writer. |
20 | 104 | - `encoded_len` is now public so you can size encode buffers precisely.
|
21 | 105 |
|
22 | 106 | # 0.13.1
|
|
28 | 112 | - Config methods are const
|
29 | 113 | - Added `EncoderStringWriter` to allow encoding directly to a String
|
30 | 114 | - `EncoderWriter` now owns its delegate writer rather than keeping a reference to it (though refs still work)
|
31 |
| - - As a consequence, it is now possible to extract the delegate writer from an `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. |
32 |
| -- When decoding input that has both an invalid length and an invalid symbol as the last byte, `InvalidByte` will be emitted instead of `InvalidLength` to make the problem more obvious. |
| 115 | + - As a consequence, it is now possible to extract the delegate writer from an `EncoderWriter` via `finish()`, which |
| 116 | + returns `Result<W>` instead of `Result<()>`. If you were calling `finish()` explicitly, you will now need to |
| 117 | + use `let _ = foo.finish()` instead of just `foo.finish()` to avoid a warning about the unused value. |
| 118 | +- When decoding input that has both an invalid length and an invalid symbol as the last byte, `InvalidByte` will be |
| 119 | + emitted instead of `InvalidLength` to make the problem more obvious. |
33 | 120 |
|
34 | 121 | # 0.12.2
|
35 | 122 |
|
|
47 | 134 | - A minor performance improvement in encoding
|
48 | 135 |
|
49 | 136 | # 0.11.0
|
| 137 | + |
50 | 138 | - Minimum rust version 1.34.0
|
51 | 139 | - `no_std` is now supported via the two new features `alloc` and `std`.
|
52 | 140 |
|
53 | 141 | # 0.10.1
|
54 | 142 |
|
55 | 143 | - Minimum rust version 1.27.2
|
56 |
| -- Fix bug in streaming encoding ([#90](https://github.com/marshallpierce/rust-base64/pull/90)): if the underlying writer didn't write all the bytes given to it, the remaining bytes would not be retried later. See the docs on `EncoderWriter::write`. |
| 144 | +- Fix bug in streaming encoding ([#90](https://github.com/marshallpierce/rust-base64/pull/90)): if the underlying writer |
| 145 | + didn't write all the bytes given to it, the remaining bytes would not be retried later. See the docs |
| 146 | + on `EncoderWriter::write`. |
57 | 147 | - Make it configurable whether or not to return an error when decoding detects excess trailing bits.
|
58 | 148 |
|
59 | 149 | # 0.10.0
|
60 | 150 |
|
61 |
| -- Remove line wrapping. Line wrapping was never a great conceptual fit in this library, and other features (streaming encoding, etc) either couldn't support it or could support only special cases of it with a great increase in complexity. Line wrapping has been pulled out into a [line-wrap](https://crates.io/crates/line-wrap) crate, so it's still available if you need it. |
62 |
| - - `Base64Display` creation no longer uses a `Result` because it can't fail, which means its helper methods for common |
63 |
| - configs that `unwrap()` for you are no longer needed |
| 151 | +- Remove line wrapping. Line wrapping was never a great conceptual fit in this library, and other features (streaming |
| 152 | + encoding, etc) either couldn't support it or could support only special cases of it with a great increase in |
| 153 | + complexity. Line wrapping has been pulled out into a [line-wrap](https://crates.io/crates/line-wrap) crate, so it's |
| 154 | + still available if you need it. |
| 155 | + - `Base64Display` creation no longer uses a `Result` because it can't fail, which means its helper methods for |
| 156 | + common |
| 157 | + configs that `unwrap()` for you are no longer needed |
64 | 158 | - Add a streaming encoder `Write` impl to transparently base64 as you write.
|
65 | 159 | - Remove the remaining `unsafe` code.
|
66 |
| -- Remove whitespace stripping to simplify `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)`. |
| 160 | +- Remove whitespace stripping to simplify `no_std` support. No out of the box configs use it, and it's trivial to do |
| 161 | + yourself if needed: `filter(|b| !b" \n\t\r\x0b\x0c".contains(b)`. |
67 | 162 | - Detect invalid trailing symbols when decoding and return an error rather than silently ignoring them.
|
68 | 163 |
|
69 | 164 | # 0.9.3
|
|
0 commit comments