Debian Codegraph @

third_party/rust/base64/RELEASE-NOTES.md

raw
1 # 0.22.1
2
3 - Correct the symbols used for the predefined `alphabet::BIN_HEX`.
4
5 # 0.22.0
6
7 - `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.
8 - `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.
9 - Decoding is somewhat faster (5-10%)
10
11 # 0.21.7
12
13 - Support getting an alphabet's contents as a str via `Alphabet::as_str()`
14
15 # 0.21.6
16
17 - Improved introductory documentation and example
18
19 # 0.21.5
20
21 - Add `Debug` and `Clone` impls for the general purpose Engine
22
23 # 0.21.4
24
25 - Make `encoded_len` `const`, allowing the creation of arrays sized to encode compile-time-known data lengths
26
27 # 0.21.3
28
29 - Implement `source` instead of `cause` on Error types
30 - Roll back MSRV to 1.48.0 so Debian can continue to live in a time warp
31 - Slightly faster chunked encoding for short inputs
32 - Decrease binary size
33
34 # 0.21.2
35
36 - Rollback MSRV to 1.57.0 -- only dev dependencies need 1.60, not the main code
37
38 # 0.21.1
39
40 - Remove the possibility of panicking during decoded length calculations
41 - `DecoderReader` no longer sometimes erroneously ignores
42 padding [#226](https://github.com/marshallpierce/rust-base64/issues/226)
43
44 ## Breaking changes
45
46 - `Engine.internal_decode` return type changed
47 - Update MSRV to 1.60.0
48
49 # 0.21.0
50
51 ## Migration
52
53 ### Functions
54
55 | < 0.20 function | 0.21 equivalent |
56 |-------------------------|-------------------------------------------------------------------------------------|
57 | `encode()` | `engine::general_purpose::STANDARD.encode()` or `prelude::BASE64_STANDARD.encode()` |
58 | `encode_config()` | `engine.encode()` |
59 | `encode_config_buf()` | `engine.encode_string()` |
60 | `encode_config_slice()` | `engine.encode_slice()` |
61 | `decode()` | `engine::general_purpose::STANDARD.decode()` or `prelude::BASE64_STANDARD.decode()` |
62 | `decode_config()` | `engine.decode()` |
63 | `decode_config_buf()` | `engine.decode_vec()` |
64 | `decode_config_slice()` | `engine.decode_slice()` |
65
66 The short-lived 0.20 functions were the 0.13 functions with `config` replaced with `engine`.
67
68 ### Padding
69
70 If applicable, use the preset engines `engine::STANDARD`, `engine::STANDARD_NO_PAD`, `engine::URL_SAFE`,
71 or `engine::URL_SAFE_NO_PAD`.
72 The `NO_PAD` ones require that padding is absent when decoding, and the others require that
73 canonical padding is present .
74
75 If you need the < 0.20 behavior that did not care about padding, or want to recreate < 0.20.0's predefined `Config`s
76 precisely, see the following table.
77
78 | 0.13.1 Config | 0.20.0+ alphabet | `encode_padding` | `decode_padding_mode` |
79 |-----------------|------------------|------------------|-----------------------|
80 | STANDARD | STANDARD | true | Indifferent |
81 | STANDARD_NO_PAD | STANDARD | false | Indifferent |
82 | URL_SAFE | URL_SAFE | true | Indifferent |
83 | URL_SAFE_NO_PAD | URL_SAFE | false | Indifferent |
84
85 # 0.21.0-rc.1
86
87 - Restore the ability to decode into a slice of precisely the correct length with `Engine.decode_slice_unchecked`.
88 - Add `Engine` as a `pub use` in `prelude`.
89
90 # 0.21.0-beta.2
91
92 ## Breaking changes
93
94 - Re-exports of preconfigured engines in `engine` are removed in favor of `base64::prelude::...` that are better suited
95 to those who wish to `use` the entire path to a name.
96
97 # 0.21.0-beta.1
98
99 ## Breaking changes
100
101 - `FastPortable` was only meant to be an interim name, and shouldn't have shipped in 0.20. It is now `GeneralPurpose` to
102 make its intended usage more clear.
103 - `GeneralPurpose` and its config are now `pub use`'d in the `engine` module for convenience.
104 - Change a few `from()` functions to be `new()`. `from()` causes confusing compiler errors because of confusion
105 with `From::from`, and is a little misleading because some of those invocations are not very cheap as one would
106 usually expect from a `from` call.
107 - `encode*` and `decode*` top level functions are now methods on `Engine`.
108 - `DEFAULT_ENGINE` was replaced by `engine::general_purpose::STANDARD`
109 - Predefined engine consts `engine::general_purpose::{STANDARD, STANDARD_NO_PAD, URL_SAFE, URL_SAFE_NO_PAD}`
110 - These are `pub use`d into `engine` as well
111 - The `*_slice` decode/encode functions now return an error instead of panicking when the output slice is too small
112 - As part of this, there isn't now a public way to decode into a slice _exactly_ the size needed for inputs that
113 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
114 a problem, file an issue.
115
116 ## Other changes
117
118 - `decoded_len_estimate()` is provided to make it easy to size decode buffers correctly.
119
120 # 0.20.0
121
122 ## Breaking changes
123
124 - Update MSRV to 1.57.0
125 - Decoding can now either ignore padding, require correct padding, or require no padding. The default is to require
126 correct padding.
127 - The `NO_PAD` config now requires that padding be absent when decoding.
128
129 ## 0.20.0-alpha.1
130
131 ### Breaking changes
132
133 - Extended the `Config` concept into the `Engine` abstraction, allowing the user to pick different encoding / decoding
134 implementations.
135 - What was formerly the only algorithm is now the `FastPortable` engine, so named because it's portable (works on
136 any CPU) and relatively fast.
137 - This opens the door to a portable constant-time
138 implementation ([#153](https://github.com/marshallpierce/rust-base64/pull/153),
139 presumably `ConstantTimePortable`?) for security-sensitive applications that need side-channel resistance, and
140 CPU-specific SIMD implementations for more speed.
141 - Standard base64 per the RFC is available via `DEFAULT_ENGINE`. To use different alphabets or other settings (
142 padding, etc), create your own engine instance.
143 - `CharacterSet` is now `Alphabet` (per the RFC), and allows creating custom alphabets. The corresponding tables that
144 were previously code-generated are now built dynamically.
145 - Since there are already multiple breaking changes, various functions are renamed to be more consistent and
146 discoverable.
147 - MSRV is now 1.47.0 to allow various things to use `const fn`.
148 - `DecoderReader` now owns its inner reader, and can expose it via `into_inner()`. For symmetry, `EncoderWriter` can do
149 the same with its writer.
150 - `encoded_len` is now public so you can size encode buffers precisely.
151
152 # 0.13.1
153
154 - More precise decode buffer sizing, avoiding unnecessary allocation in `decode_config`.
155
156 # 0.13.0
157
158 - Config methods are const
159 - Added `EncoderStringWriter` to allow encoding directly to a String
160 - `EncoderWriter` now owns its delegate writer rather than keeping a reference to it (though refs still work)
161 - As a consequence, it is now possible to extract the delegate writer from an `EncoderWriter` via `finish()`, which
162 returns `Result<W>` instead of `Result<()>`. If you were calling `finish()` explicitly, you will now need to
163 use `let _ = foo.finish()` instead of just `foo.finish()` to avoid a warning about the unused value.
164 - When decoding input that has both an invalid length and an invalid symbol as the last byte, `InvalidByte` will be
165 emitted instead of `InvalidLength` to make the problem more obvious.
166
167 # 0.12.2
168
169 - Add `BinHex` alphabet
170
171 # 0.12.1
172
173 - Add `Bcrypt` alphabet
174
175 # 0.12.0
176
177 - A `Read` implementation (`DecoderReader`) to let users transparently decoded data from a b64 input source
178 - IMAP's modified b64 alphabet
179 - Relaxed type restrictions to just `AsRef<[ut8]>` for main `encode*`/`decode*` functions
180 - A minor performance improvement in encoding
181
182 # 0.11.0
183
184 - Minimum rust version 1.34.0
185 - `no_std` is now supported via the two new features `alloc` and `std`.
186
187 # 0.10.1
188
189 - Minimum rust version 1.27.2
190 - Fix bug in streaming encoding ([#90](https://github.com/marshallpierce/rust-base64/pull/90)): if the underlying writer
191 didn't write all the bytes given to it, the remaining bytes would not be retried later. See the docs
192 on `EncoderWriter::write`.
193 - Make it configurable whether or not to return an error when decoding detects excess trailing bits.
194
195 # 0.10.0
196
197 - Remove line wrapping. Line wrapping was never a great conceptual fit in this library, and other features (streaming
198 encoding, etc) either couldn't support it or could support only special cases of it with a great increase in
199 complexity. Line wrapping has been pulled out into a [line-wrap](https://crates.io/crates/line-wrap) crate, so it's
200 still available if you need it.
201 - `Base64Display` creation no longer uses a `Result` because it can't fail, which means its helper methods for
202 common
203 configs that `unwrap()` for you are no longer needed
204 - Add a streaming encoder `Write` impl to transparently base64 as you write.
205 - Remove the remaining `unsafe` code.
206 - Remove whitespace stripping to simplify `no_std` support. No out of the box configs use it, and it's trivial to do
207 yourself if needed: `filter(|b| !b" \n\t\r\x0b\x0c".contains(b)`.
208 - Detect invalid trailing symbols when decoding and return an error rather than silently ignoring them.
209
210 # 0.9.3
211
212 - Update safemem
213
214 # 0.9.2
215
216 - Derive `Clone` for `DecodeError`.
217
218 # 0.9.1
219
220 - Add support for `crypt(3)`'s base64 variant.
221
222 # 0.9.0
223
224 - `decode_config_slice` function for no-allocation decoding, analogous to `encode_config_slice`
225 - Decode performance optimization
226
227 # 0.8.0
228
229 - `encode_config_slice` function for no-allocation encoding
230
231 # 0.7.0
232
233 - `STANDARD_NO_PAD` config
234 - `Base64Display` heap-free wrapper for use in format strings, etc
235
236 # 0.6.0
237
238 - Decode performance improvements
239 - Use `unsafe` in fewer places
240 - Added fuzzers
241
242 # 0.5.2
243
244 - Avoid usize overflow when calculating length
245 - Better line wrapping performance
246
247 # 0.5.1
248
249 - Temporarily disable line wrapping
250 - Add Apache 2.0 license
251
252 # 0.5.0
253
254 - MIME support, including configurable line endings and line wrapping
255 - Removed `decode_ws`
256 - Renamed `Base64Error` to `DecodeError`
257
258 # 0.4.1
259
260 - Allow decoding a `AsRef<[u8]>` instead of just a `&str`
261
262 # 0.4.0
263
264 - Configurable padding
265 - Encode performance improvements
266
267 # 0.3.0
268
269 - Added encode/decode functions that do not allocate their own storage
270 - Decode performance improvements
271 - Extraneous padding bytes are no longer ignored. Now, an error will be returned.