| 1 |
# Changelog |
| 2 |
All notable changes to this project will be documented in this file. |
| 3 |
|
| 4 |
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) |
| 5 |
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
| 6 |
|
| 7 |
A [separate changelog is kept for rand_core](rand_core/CHANGELOG.md). |
| 8 |
|
| 9 |
You may also find the [Upgrade Guide](https://rust-random.github.io/book/update.html) useful. |
| 10 |
|
| 11 |
## [0.8.5] - 2021-08-20 |
| 12 |
### Fixes |
| 13 |
- Fix build on non-32/64-bit architectures (#1144) |
| 14 |
- Fix "min_const_gen" feature for `no_std` (#1173) |
| 15 |
- Check `libc::pthread_atfork` return value with panic on error (#1178) |
| 16 |
- More robust reseeding in case `ReseedingRng` is used from a fork handler (#1178) |
| 17 |
- Fix nightly: remove unused `slice_partition_at_index` feature (#1215) |
| 18 |
- Fix nightly + `simd_support`: update `packed_simd` (#1216) |
| 19 |
|
| 20 |
### Rngs |
| 21 |
- `StdRng`: Switch from HC128 to ChaCha12 on emscripten (#1142). |
| 22 |
We now use ChaCha12 on all platforms. |
| 23 |
|
| 24 |
### Documentation |
| 25 |
- Added docs about rand's use of const generics (#1150) |
| 26 |
- Better random chars example (#1157) |
| 27 |
|
| 28 |
|
| 29 |
## [0.8.4] - 2021-06-15 |
| 30 |
### Additions |
| 31 |
- Use const-generics to support arrays of all sizes (#1104) |
| 32 |
- Implement `Clone` and `Copy` for `Alphanumeric` (#1126) |
| 33 |
- Add `Distribution::map` to derive a distribution using a closure (#1129) |
| 34 |
- Add `Slice` distribution (#1107) |
| 35 |
- Add `DistString` trait with impls for `Standard` and `Alphanumeric` (#1133) |
| 36 |
|
| 37 |
### Other |
| 38 |
- Reorder asserts in `Uniform` float distributions for easier debugging of non-finite arguments |
| 39 |
(#1094, #1108) |
| 40 |
- Add range overflow check in `Uniform` float distributions (#1108) |
| 41 |
- Deprecate `rngs::adapter::ReadRng` (#1130) |
| 42 |
|
| 43 |
## [0.8.3] - 2021-01-25 |
| 44 |
### Fixes |
| 45 |
- Fix `no-std` + `alloc` build by gating `choose_multiple_weighted` on `std` (#1088) |
| 46 |
|
| 47 |
## [0.8.2] - 2021-01-12 |
| 48 |
### Fixes |
| 49 |
- Fix panic in `UniformInt::sample_single_inclusive` and `Rng::gen_range` when |
| 50 |
providing a full integer range (eg `0..=MAX`) (#1087) |
| 51 |
|
| 52 |
## [0.8.1] - 2020-12-31 |
| 53 |
### Other |
| 54 |
- Enable all stable features in the playground (#1081) |
| 55 |
|
| 56 |
## [0.8.0] - 2020-12-18 |
| 57 |
### Platform support |
| 58 |
- The minimum supported Rust version is now 1.36 (#1011) |
| 59 |
- `getrandom` updated to v0.2 (#1041) |
| 60 |
- Remove `wasm-bindgen` and `stdweb` feature flags. For details of WASM support, |
| 61 |
see the [getrandom documentation](https://docs.rs/getrandom/latest). (#948) |
| 62 |
- `ReadRng::next_u32` and `next_u64` now use little-Endian conversion instead |
| 63 |
of native-Endian, affecting results on Big-Endian platforms (#1061) |
| 64 |
- The `nightly` feature no longer implies the `simd_support` feature (#1048) |
| 65 |
- Fix `simd_support` feature to work on current nightlies (#1056) |
| 66 |
|
| 67 |
### Rngs |
| 68 |
- `ThreadRng` is no longer `Copy` to enable safe usage within thread-local destructors (#1035) |
| 69 |
- `gen_range(a, b)` was replaced with `gen_range(a..b)`. `gen_range(a..=b)` is |
| 70 |
also supported. Note that `a` and `b` can no longer be references or SIMD types. (#744, #1003) |
| 71 |
- Replace `AsByteSliceMut` with `Fill` and add support for `[bool], [char], [f32], [f64]` (#940) |
| 72 |
- Restrict `rand::rngs::adapter` to `std` (#1027; see also #928) |
| 73 |
- `StdRng`: add new `std_rng` feature flag (enabled by default, but might need |
| 74 |
to be used if disabling default crate features) (#948) |
| 75 |
- `StdRng`: Switch from ChaCha20 to ChaCha12 for better performance (#1028) |
| 76 |
- `SmallRng`: Replace PCG algorithm with xoshiro{128,256}++ (#1038) |
| 77 |
|
| 78 |
### Sequences |
| 79 |
- Add `IteratorRandom::choose_stable` as an alternative to `choose` which does |
| 80 |
not depend on size hints (#1057) |
| 81 |
- Improve accuracy and performance of `IteratorRandom::choose` (#1059) |
| 82 |
- Implement `IntoIterator` for `IndexVec`, replacing the `into_iter` method (#1007) |
| 83 |
- Add value stability tests for `seq` module (#933) |
| 84 |
|
| 85 |
### Misc |
| 86 |
- Support `PartialEq` and `Eq` for `StdRng`, `SmallRng` and `StepRng` (#979) |
| 87 |
- Added a `serde1` feature and added Serialize/Deserialize to `UniformInt` and `WeightedIndex` (#974) |
| 88 |
- Drop some unsafe code (#962, #963, #1011) |
| 89 |
- Reduce packaged crate size (#983) |
| 90 |
- Migrate to GitHub Actions from Travis+AppVeyor (#1073) |
| 91 |
|
| 92 |
### Distributions |
| 93 |
- `Alphanumeric` samples bytes instead of chars (#935) |
| 94 |
- `Uniform` now supports `char`, enabling `rng.gen_range('A'..='Z')` (#1068) |
| 95 |
- Add `UniformSampler::sample_single_inclusive` (#1003) |
| 96 |
|
| 97 |
#### Weighted sampling |
| 98 |
- Implement weighted sampling without replacement (#976, #1013) |
| 99 |
- `rand::distributions::alias_method::WeightedIndex` was moved to `rand_distr::WeightedAliasIndex`. |
| 100 |
The simpler alternative `rand::distribution::WeightedIndex` remains. (#945) |
| 101 |
- Improve treatment of rounding errors in `WeightedIndex::update_weights` (#956) |
| 102 |
- `WeightedIndex`: return error on NaN instead of panic (#1005) |
| 103 |
|
| 104 |
### Documentation |
| 105 |
- Document types supported by `random` (#994) |
| 106 |
- Document notes on password generation (#995) |
| 107 |
- Note that `SmallRng` may not be the best choice for performance and in some |
| 108 |
other cases (#1038) |
| 109 |
- Use `doc(cfg)` to annotate feature-gated items (#1019) |
| 110 |
- Adjust README (#1065) |
| 111 |
|
| 112 |
## [0.7.3] - 2020-01-10 |
| 113 |
### Fixes |
| 114 |
- The `Bernoulli` distribution constructors now reports an error on NaN and on |
| 115 |
`denominator == 0`. (#925) |
| 116 |
- Use `std::sync::Once` to register fork handler, avoiding possible atomicity violation (#928) |
| 117 |
- Fix documentation on the precision of generated floating-point values |
| 118 |
|
| 119 |
### Changes |
| 120 |
- Unix: make libc dependency optional; only use fork protection with std feature (#928) |
| 121 |
|
| 122 |
### Additions |
| 123 |
- Implement `std::error::Error` for `BernoulliError` (#919) |
| 124 |
|
| 125 |
## [0.7.2] - 2019-09-16 |
| 126 |
### Fixes |
| 127 |
- Fix dependency on `rand_core` 0.5.1 (#890) |
| 128 |
|
| 129 |
### Additions |
| 130 |
- Unit tests for value stability of distributions added (#888) |
| 131 |
|
| 132 |
## [0.7.1] - 2019-09-13 |
| 133 |
### Yanked |
| 134 |
This release was yanked since it depends on `rand_core::OsRng` added in 0.5.1 |
| 135 |
but specifies a dependency on version 0.5.0 (#890), causing a broken builds |
| 136 |
when updating from `rand 0.7.0` without also updating `rand_core`. |
| 137 |
|
| 138 |
### Fixes |
| 139 |
- Fix `no_std` behaviour, appropriately enable c2-chacha's `std` feature (#844) |
| 140 |
- `alloc` feature in `no_std` is available since Rust 1.36 (#856) |
| 141 |
- Fix or squelch issues from Clippy lints (#840) |
| 142 |
|
| 143 |
### Additions |
| 144 |
- Add a `no_std` target to CI to continuously evaluate `no_std` status (#844) |
| 145 |
- `WeightedIndex`: allow adjusting a sub-set of weights (#866) |
| 146 |
|
| 147 |
## [0.7.0] - 2019-06-28 |
| 148 |
|
| 149 |
### Fixes |
| 150 |
- Fix incorrect pointer usages revealed by Miri testing (#780, #781) |
| 151 |
- Fix (tiny!) bias in `Uniform` for 8- and 16-bit ints (#809) |
| 152 |
|
| 153 |
### Crate |
| 154 |
- Bumped MSRV (min supported Rust version) to 1.32.0 |
| 155 |
- Updated to Rust Edition 2018 (#823, #824) |
| 156 |
- Removed dependence on `rand_xorshift`, `rand_isaac`, `rand_jitter` crates (#759, #765) |
| 157 |
- Remove dependency on `winapi` (#724) |
| 158 |
- Removed all `build.rs` files (#824) |
| 159 |
- Removed code already deprecated in version 0.6 (#757) |
| 160 |
- Removed the serde1 feature (It's still available for backwards compatibility, but it does not do anything. #830) |
| 161 |
- Many documentation changes |
| 162 |
|
| 163 |
### rand_core |
| 164 |
- Updated to `rand_core` 0.5.0 |
| 165 |
- `Error` type redesigned with new API (#800) |
| 166 |
- Move `from_entropy` method to `SeedableRng` and remove `FromEntropy` (#800) |
| 167 |
- `SeedableRng::from_rng` is now expected to be value-stable (#815) |
| 168 |
|
| 169 |
### Standard RNGs |
| 170 |
- OS interface moved from `rand_os` to new `getrandom` crate (#765, [getrandom](https://github.com/rust-random/getrandom)) |
| 171 |
- Use ChaCha for `StdRng` and `ThreadRng` (#792) |
| 172 |
- Feature-gate `SmallRng` (#792) |
| 173 |
- `ThreadRng` now supports `Copy` (#758) |
| 174 |
- Deprecated `EntropyRng` (#765) |
| 175 |
- Enable fork protection of ReseedingRng without `std` (#724) |
| 176 |
|
| 177 |
### Distributions |
| 178 |
- Many distributions have been moved to `rand_distr` (#761) |
| 179 |
- `Bernoulli::new` constructor now returns a `Result` (#803) |
| 180 |
- `Distribution::sample_iter` adjusted for more flexibility (#758) |
| 181 |
- Added `distributions::weighted::alias_method::WeightedIndex` for `O(1)` sampling (#692) |
| 182 |
- Support sampling `NonZeroU*` types with the `Standard` distribution (#728) |
| 183 |
- Optimised `Binomial` distribution sampling (#735, #740, #752) |
| 184 |
- Optimised SIMD float sampling (#739) |
| 185 |
|
| 186 |
### Sequences |
| 187 |
- Make results portable across 32- and 64-bit by using `u32` samples for `usize` where possible (#809) |
| 188 |
|
| 189 |
## [0.6.5] - 2019-01-28 |
| 190 |
### Crates |
| 191 |
- Update `rand_core` to 0.4 (#703) |
| 192 |
- Move `JitterRng` to its own crate (#685) |
| 193 |
- Add a wasm-bindgen test crate (#696) |
| 194 |
|
| 195 |
### Platforms |
| 196 |
- Fuchsia: Replaced fuchsia-zircon with fuchsia-cprng |
| 197 |
|
| 198 |
### Doc |
| 199 |
- Use RFC 1946 for doc links (#691) |
| 200 |
- Fix some doc links and notes (#711) |
| 201 |
|
| 202 |
## [0.6.4] - 2019-01-08 |
| 203 |
### Fixes |
| 204 |
- Move wasm-bindgen shims to correct crate (#686) |
| 205 |
- Make `wasm32-unknown-unknown` compile but fail at run-time if missing bindingsg (#686) |
| 206 |
|
| 207 |
## [0.6.3] - 2019-01-04 |
| 208 |
### Fixes |
| 209 |
- Make the `std` feature require the optional `rand_os` dependency (#675) |
| 210 |
- Re-export the optional WASM dependencies of `rand_os` from `rand` to avoid breakage (#674) |
| 211 |
|
| 212 |
## [0.6.2] - 2019-01-04 |
| 213 |
### Additions |
| 214 |
- Add `Default` for `ThreadRng` (#657) |
| 215 |
- Move `rngs::OsRng` to `rand_os` sub-crate; clean up code; use as dependency (#643) ##BLOCKER## |
| 216 |
- Add `rand_xoshiro` sub-crate, plus benchmarks (#642, #668) |
| 217 |
|
| 218 |
### Fixes |
| 219 |
- Fix bias in `UniformInt::sample_single` (#662) |
| 220 |
- Use `autocfg` instead of `rustc_version` for rustc version detection (#664) |
| 221 |
- Disable `i128` and `u128` if the `target_os` is `emscripten` (#671: work-around Emscripten limitation) |
| 222 |
- CI fixes (#660, #671) |
| 223 |
|
| 224 |
### Optimisations |
| 225 |
- Optimise memory usage of `UnitCircle` and `UnitSphereSurface` distributions (no PR) |
| 226 |
|
| 227 |
## [0.6.1] - 2018-11-22 |
| 228 |
- Support sampling `Duration` also for `no_std` (only since Rust 1.25) (#649) |
| 229 |
- Disable default features of `libc` (#647) |
| 230 |
|
| 231 |
## [0.6.0] - 2018-11-14 |
| 232 |
|
| 233 |
### Project organisation |
| 234 |
- Rand has moved from [rust-lang-nursery](https://github.com/rust-lang-nursery/rand) |
| 235 |
to [rust-random](https://github.com/rust-random/rand)! (#578) |
| 236 |
- Created [The Rust Random Book](https://rust-random.github.io/book/) |
| 237 |
([source](https://github.com/rust-random/book)) |
| 238 |
- Update copyright and licence notices (#591, #611) |
| 239 |
- Migrate policy documentation from the wiki (#544) |
| 240 |
|
| 241 |
### Platforms |
| 242 |
- Add fork protection on Unix (#466) |
| 243 |
- Added support for wasm-bindgen. (#541, #559, #562, #600) |
| 244 |
- Enable `OsRng` for powerpc64, sparc and sparc64 (#609) |
| 245 |
- Use `syscall` from `libc` on Linux instead of redefining it (#629) |
| 246 |
|
| 247 |
### RNGs |
| 248 |
- Switch `SmallRng` to use PCG (#623) |
| 249 |
- Implement `Pcg32` and `Pcg64Mcg` generators (#632) |
| 250 |
- Move ISAAC RNGs to a dedicated crate (#551) |
| 251 |
- Move Xorshift RNG to its own crate (#557) |
| 252 |
- Move ChaCha and HC128 RNGs to dedicated crates (#607, #636) |
| 253 |
- Remove usage of `Rc` from `ThreadRng` (#615) |
| 254 |
|
| 255 |
### Sampling and distributions |
| 256 |
- Implement `Rng.gen_ratio()` and `Bernoulli::new_ratio()` (#491) |
| 257 |
- Make `Uniform` strictly respect `f32` / `f64` high/low bounds (#477) |
| 258 |
- Allow `gen_range` and `Uniform` to work on non-`Copy` types (#506) |
| 259 |
- `Uniform` supports inclusive ranges: `Uniform::from(a..=b)`. This is |
| 260 |
automatically enabled for Rust >= 1.27. (#566) |
| 261 |
- Implement `TrustedLen` and `FusedIterator` for `DistIter` (#620) |
| 262 |
|
| 263 |
#### New distributions |
| 264 |
- Add the `Dirichlet` distribution (#485) |
| 265 |
- Added sampling from the unit sphere and circle. (#567) |
| 266 |
- Implement the triangular distribution (#575) |
| 267 |
- Implement the Weibull distribution (#576) |
| 268 |
- Implement the Beta distribution (#574) |
| 269 |
|
| 270 |
#### Optimisations |
| 271 |
|
| 272 |
- Optimise `Bernoulli::new` (#500) |
| 273 |
- Optimise `char` sampling (#519) |
| 274 |
- Optimise sampling of `std::time::Duration` (#583) |
| 275 |
|
| 276 |
### Sequences |
| 277 |
- Redesign the `seq` module (#483, #515) |
| 278 |
- Add `WeightedIndex` and `choose_weighted` (#518, #547) |
| 279 |
- Optimised and changed return type of the `sample_indices` function. (#479) |
| 280 |
- Use `Iterator::size_hint()` to speed up `IteratorRandom::choose` (#593) |
| 281 |
|
| 282 |
### SIMD |
| 283 |
- Support for generating SIMD types (#523, #542, #561, #630) |
| 284 |
|
| 285 |
### Other |
| 286 |
- Revise CI scripts (#632, #635) |
| 287 |
- Remove functionality already deprecated in 0.5 (#499) |
| 288 |
- Support for `i128` and `u128` is automatically enabled for Rust >= 1.26. This |
| 289 |
renders the `i128_support` feature obsolete. It still exists for backwards |
| 290 |
compatibility but does not have any effect. This breaks programs using Rand |
| 291 |
with `i128_support` on nightlies older than Rust 1.26. (#571) |
| 292 |
|
| 293 |
|
| 294 |
## [0.5.5] - 2018-08-07 |
| 295 |
### Documentation |
| 296 |
- Fix links in documentation (#582) |
| 297 |
|
| 298 |
|
| 299 |
## [0.5.4] - 2018-07-11 |
| 300 |
### Platform support |
| 301 |
- Make `OsRng` work via WASM/stdweb for WebWorkers |
| 302 |
|
| 303 |
|
| 304 |
## [0.5.3] - 2018-06-26 |
| 305 |
### Platform support |
| 306 |
- OpenBSD, Bitrig: fix compilation (broken in 0.5.1) (#530) |
| 307 |
|
| 308 |
|
| 309 |
## [0.5.2] - 2018-06-18 |
| 310 |
### Platform support |
| 311 |
- Hide `OsRng` and `JitterRng` on unsupported platforms (#512; fixes #503). |
| 312 |
|
| 313 |
|
| 314 |
## [0.5.1] - 2018-06-08 |
| 315 |
|
| 316 |
### New distributions |
| 317 |
- Added Cauchy distribution. (#474, #486) |
| 318 |
- Added Pareto distribution. (#495) |
| 319 |
|
| 320 |
### Platform support and `OsRng` |
| 321 |
- Remove blanket Unix implementation. (#484) |
| 322 |
- Remove Wasm unimplemented stub. (#484) |
| 323 |
- Dragonfly BSD: read from `/dev/random`. (#484) |
| 324 |
- Bitrig: use `getentropy` like OpenBSD. (#484) |
| 325 |
- Solaris: (untested) use `getrandom` if available, otherwise `/dev/random`. (#484) |
| 326 |
- Emscripten, `stdweb`: split the read up in chunks. (#484) |
| 327 |
- Emscripten, Haiku: don't do an extra blocking read from `/dev/random`. (#484) |
| 328 |
- Linux, NetBSD, Solaris: read in blocking mode on first use in `fill_bytes`. (#484) |
| 329 |
- Fuchsia, CloudABI: fix compilation (broken in Rand 0.5). (#484) |
| 330 |
|
| 331 |
|
| 332 |
## [0.5.0] - 2018-05-21 |
| 333 |
|
| 334 |
### Crate features and organisation |
| 335 |
- Minimum Rust version update: 1.22.0. (#239) |
| 336 |
- Create a separate `rand_core` crate. (#288) |
| 337 |
- Deprecate `rand_derive`. (#256) |
| 338 |
- Add `prelude` (and module reorganisation). (#435) |
| 339 |
- Add `log` feature. Logging is now available in `JitterRng`, `OsRng`, `EntropyRng` and `ReseedingRng`. (#246) |
| 340 |
- Add `serde1` feature for some PRNGs. (#189) |
| 341 |
- `stdweb` feature for `OsRng` support on WASM via stdweb. (#272, #336) |
| 342 |
|
| 343 |
### `Rng` trait |
| 344 |
- Split `Rng` in `RngCore` and `Rng` extension trait. |
| 345 |
`next_u32`, `next_u64` and `fill_bytes` are now part of `RngCore`. (#265) |
| 346 |
- Add `Rng::sample`. (#256) |
| 347 |
- Deprecate `Rng::gen_weighted_bool`. (#308) |
| 348 |
- Add `Rng::gen_bool`. (#308) |
| 349 |
- Remove `Rng::next_f32` and `Rng::next_f64`. (#273) |
| 350 |
- Add optimized `Rng::fill` and `Rng::try_fill` methods. (#247) |
| 351 |
- Deprecate `Rng::gen_iter`. (#286) |
| 352 |
- Deprecate `Rng::gen_ascii_chars`. (#279) |
| 353 |
|
| 354 |
### `rand_core` crate |
| 355 |
- `rand` now depends on new `rand_core` crate (#288) |
| 356 |
- `RngCore` and `SeedableRng` are now part of `rand_core`. (#288) |
| 357 |
- Add modules to help implementing RNGs `impl` and `le`. (#209, #228) |
| 358 |
- Add `Error` and `ErrorKind`. (#225) |
| 359 |
- Add `CryptoRng` marker trait. (#273) |
| 360 |
- Add `BlockRngCore` trait. (#281) |
| 361 |
- Add `BlockRng` and `BlockRng64` wrappers to help implementations. (#281, #325) |
| 362 |
- Revise the `SeedableRng` trait. (#233) |
| 363 |
- Remove default implementations for `RngCore::next_u64` and `RngCore::fill_bytes`. (#288) |
| 364 |
- Add `RngCore::try_fill_bytes`. (#225) |
| 365 |
|
| 366 |
### Other traits and types |
| 367 |
- Add `FromEntropy` trait. (#233, #375) |
| 368 |
- Add `SmallRng` wrapper. (#296) |
| 369 |
- Rewrite `ReseedingRng` to only work with `BlockRngCore` (substantial performance improvement). (#281) |
| 370 |
- Deprecate `weak_rng`. Use `SmallRng` instead. (#296) |
| 371 |
- Deprecate `AsciiGenerator`. (#279) |
| 372 |
|
| 373 |
### Random number generators |
| 374 |
- Switch `StdRng` and `thread_rng` to HC-128. (#277) |
| 375 |
- `StdRng` must now be created with `from_entropy` instead of `new` |
| 376 |
- Change `thread_rng` reseeding threshold to 32 MiB. (#277) |
| 377 |
- PRNGs no longer implement `Copy`. (#209) |
| 378 |
- `Debug` implementations no longer show internals. (#209) |
| 379 |
- Implement `Clone` for `ReseedingRng`, `JitterRng`, OsRng`. (#383, #384) |
| 380 |
- Implement serialization for `XorShiftRng`, `IsaacRng` and `Isaac64Rng` under the `serde1` feature. (#189) |
| 381 |
- Implement `BlockRngCore` for `ChaChaCore` and `Hc128Core`. (#281) |
| 382 |
- All PRNGs are now portable across big- and little-endian architectures. (#209) |
| 383 |
- `Isaac64Rng::next_u32` no longer throws away half the results. (#209) |
| 384 |
- Add `IsaacRng::new_from_u64` and `Isaac64Rng::new_from_u64`. (#209) |
| 385 |
- Add the HC-128 CSPRNG `Hc128Rng`. (#210) |
| 386 |
- Change ChaCha20 to have 64-bit counter and 64-bit stream. (#349) |
| 387 |
- Changes to `JitterRng` to get its size down from 2112 to 24 bytes. (#251) |
| 388 |
- Various performance improvements to all PRNGs. |
| 389 |
|
| 390 |
### Platform support and `OsRng` |
| 391 |
- Add support for CloudABI. (#224) |
| 392 |
- Remove support for NaCl. (#225) |
| 393 |
- WASM support for `OsRng` via stdweb, behind the `stdweb` feature. (#272, #336) |
| 394 |
- Use `getrandom` on more platforms for Linux, and on Android. (#338) |
| 395 |
- Use the `SecRandomCopyBytes` interface on macOS. (#322) |
| 396 |
- On systems that do not have a syscall interface, only keep a single file descriptor open for `OsRng`. (#239) |
| 397 |
- On Unix, first try a single read from `/dev/random`, then `/dev/urandom`. (#338) |
| 398 |
- Better error handling and reporting in `OsRng` (using new error type). (#225) |
| 399 |
- `OsRng` now uses non-blocking when available. (#225) |
| 400 |
- Add `EntropyRng`, which provides `OsRng`, but has `JitterRng` as a fallback. (#235) |
| 401 |
|
| 402 |
### Distributions |
| 403 |
- New `Distribution` trait. (#256) |
| 404 |
- Add `Distribution::sample_iter` and `Rng::::sample_iter`. (#361) |
| 405 |
- Deprecate `Rand`, `Sample` and `IndependentSample` traits. (#256) |
| 406 |
- Add a `Standard` distribution (replaces most `Rand` implementations). (#256) |
| 407 |
- Add `Binomial` and `Poisson` distributions. (#96) |
| 408 |
- Add `Bernoulli` dsitribution. (#411) |
| 409 |
- Add `Alphanumeric` distribution. (#279) |
| 410 |
- Remove `Closed01` distribution, add `OpenClosed01`. (#274, #420) |
| 411 |
- Rework `Range` type, making it possible to implement it for user types. (#274) |
| 412 |
- Rename `Range` to `Uniform`. (#395) |
| 413 |
- Add `Uniform::new_inclusive` for inclusive ranges. (#274) |
| 414 |
- Use widening multiply method for much faster integer range reduction. (#274) |
| 415 |
- `Standard` distribution for `char` uses `Uniform` internally. (#274) |
| 416 |
- `Standard` distribution for `bool` uses sign test. (#274) |
| 417 |
- Implement `Standard` distribution for `Wrapping<T>`. (#436) |
| 418 |
- Implement `Uniform` distribution for `Duration`. (#427) |
| 419 |
|
| 420 |
|
| 421 |
## [0.4.3] - 2018-08-16 |
| 422 |
### Fixed |
| 423 |
- Use correct syscall number for PowerPC (#589) |
| 424 |
|
| 425 |
|
| 426 |
## [0.4.2] - 2018-01-06 |
| 427 |
### Changed |
| 428 |
- Use `winapi` on Windows |
| 429 |
- Update for Fuchsia OS |
| 430 |
- Remove dev-dependency on `log` |
| 431 |
|
| 432 |
|
| 433 |
## [0.4.1] - 2017-12-17 |
| 434 |
### Added |
| 435 |
- `no_std` support |
| 436 |
|
| 437 |
|
| 438 |
## [0.4.0-pre.0] - 2017-12-11 |
| 439 |
### Added |
| 440 |
- `JitterRng` added as a high-quality alternative entropy source using the |
| 441 |
system timer |
| 442 |
- new `seq` module with `sample_iter`, `sample_slice`, etc. |
| 443 |
- WASM support via dummy implementations (fail at run-time) |
| 444 |
- Additional benchmarks, covering generators and new seq code |
| 445 |
|
| 446 |
### Changed |
| 447 |
- `thread_rng` uses `JitterRng` if seeding from system time fails |
| 448 |
(slower but more secure than previous method) |
| 449 |
|
| 450 |
### Deprecated |
| 451 |
- `sample` function deprecated (replaced by `sample_iter`) |
| 452 |
|
| 453 |
|
| 454 |
## [0.3.20] - 2018-01-06 |
| 455 |
### Changed |
| 456 |
- Remove dev-dependency on `log` |
| 457 |
- Update `fuchsia-zircon` dependency to 0.3.2 |
| 458 |
|
| 459 |
|
| 460 |
## [0.3.19] - 2017-12-27 |
| 461 |
### Changed |
| 462 |
- Require `log <= 0.3.8` for dev builds |
| 463 |
- Update `fuchsia-zircon` dependency to 0.3 |
| 464 |
- Fix broken links in docs (to unblock compiler docs testing CI) |
| 465 |
|
| 466 |
|
| 467 |
## [0.3.18] - 2017-11-06 |
| 468 |
### Changed |
| 469 |
- `thread_rng` is seeded from the system time if `OsRng` fails |
| 470 |
- `weak_rng` now uses `thread_rng` internally |
| 471 |
|
| 472 |
|
| 473 |
## [0.3.17] - 2017-10-07 |
| 474 |
### Changed |
| 475 |
- Fuchsia: Magenta was renamed Zircon |
| 476 |
|
| 477 |
## [0.3.16] - 2017-07-27 |
| 478 |
### Added |
| 479 |
- Implement Debug for mote non-public types |
| 480 |
- implement `Rand` for (i|u)i128 |
| 481 |
- Support for Fuchsia |
| 482 |
|
| 483 |
### Changed |
| 484 |
- Add inline attribute to SampleRange::construct_range. |
| 485 |
This improves the benchmark for sample in 11% and for shuffle in 16%. |
| 486 |
- Use `RtlGenRandom` instead of `CryptGenRandom` |
| 487 |
|
| 488 |
|
| 489 |
## [0.3.15] - 2016-11-26 |
| 490 |
### Added |
| 491 |
- Add `Rng` trait method `choose_mut` |
| 492 |
- Redox support |
| 493 |
|
| 494 |
### Changed |
| 495 |
- Use `arc4rand` for `OsRng` on FreeBSD. |
| 496 |
- Use `arc4random(3)` for `OsRng` on OpenBSD. |
| 497 |
|
| 498 |
### Fixed |
| 499 |
- Fix filling buffers 4 GiB or larger with `OsRng::fill_bytes` on Windows |
| 500 |
|
| 501 |
|
| 502 |
## [0.3.14] - 2016-02-13 |
| 503 |
### Fixed |
| 504 |
- Inline definitions from winapi/advapi32, which decreases build times |
| 505 |
|
| 506 |
|
| 507 |
## [0.3.13] - 2016-01-09 |
| 508 |
### Fixed |
| 509 |
- Compatible with Rust 1.7.0-nightly (needed some extra type annotations) |
| 510 |
|
| 511 |
|
| 512 |
## [0.3.12] - 2015-11-09 |
| 513 |
### Changed |
| 514 |
- Replaced the methods in `next_f32` and `next_f64` with the technique described |
| 515 |
Saito & Matsumoto at MCQMC'08. The new method should exhibit a slightly more |
| 516 |
uniform distribution. |
| 517 |
- Depend on libc 0.2 |
| 518 |
|
| 519 |
### Fixed |
| 520 |
- Fix iterator protocol issue in `rand::sample` |
| 521 |
|
| 522 |
|
| 523 |
## [0.3.11] - 2015-08-31 |
| 524 |
### Added |
| 525 |
- Implement `Rand` for arrays with n <= 32 |
| 526 |
|
| 527 |
|
| 528 |
## [0.3.10] - 2015-08-17 |
| 529 |
### Added |
| 530 |
- Support for NaCl platforms |
| 531 |
|
| 532 |
### Changed |
| 533 |
- Allow `Rng` to be `?Sized`, impl for `&mut R` and `Box<R>` where `R: ?Sized + Rng` |
| 534 |
|
| 535 |
|
| 536 |
## [0.3.9] - 2015-06-18 |
| 537 |
### Changed |
| 538 |
- Use `winapi` for Windows API things |
| 539 |
|
| 540 |
### Fixed |
| 541 |
- Fixed test on stable/nightly |
| 542 |
- Fix `getrandom` syscall number for aarch64-unknown-linux-gnu |
| 543 |
|
| 544 |
|
| 545 |
## [0.3.8] - 2015-04-23 |
| 546 |
### Changed |
| 547 |
- `log` is a dev dependency |
| 548 |
|
| 549 |
### Fixed |
| 550 |
- Fix race condition of atomics in `is_getrandom_available` |
| 551 |
|
| 552 |
|
| 553 |
## [0.3.7] - 2015-04-03 |
| 554 |
### Fixed |
| 555 |
- Derive Copy/Clone changes |
| 556 |
|
| 557 |
|
| 558 |
## [0.3.6] - 2015-04-02 |
| 559 |
### Changed |
| 560 |
- Move to stable Rust! |
| 561 |
|
| 562 |
|
| 563 |
## [0.3.5] - 2015-04-01 |
| 564 |
### Fixed |
| 565 |
- Compatible with Rust master |
| 566 |
|
| 567 |
|
| 568 |
## [0.3.4] - 2015-03-31 |
| 569 |
### Added |
| 570 |
- Implement Clone for `Weighted` |
| 571 |
|
| 572 |
### Fixed |
| 573 |
- Compatible with Rust master |
| 574 |
|
| 575 |
|
| 576 |
## [0.3.3] - 2015-03-26 |
| 577 |
### Fixed |
| 578 |
- Fix compile on Windows |
| 579 |
|
| 580 |
|
| 581 |
## [0.3.2] - 2015-03-26 |
| 582 |
|
| 583 |
|
| 584 |
## [0.3.1] - 2015-03-26 |
| 585 |
### Fixed |
| 586 |
- Fix compile on Windows |
| 587 |
|
| 588 |
|
| 589 |
## [0.3.0] - 2015-03-25 |
| 590 |
### Changed |
| 591 |
- Update to use log version 0.3.x |
| 592 |
|
| 593 |
|
| 594 |
## [0.2.1] - 2015-03-22 |
| 595 |
### Fixed |
| 596 |
- Compatible with Rust master |
| 597 |
- Fixed iOS compilation |
| 598 |
|
| 599 |
|
| 600 |
## [0.2.0] - 2015-03-06 |
| 601 |
### Fixed |
| 602 |
- Compatible with Rust master (move from `old_io` to `std::io`) |
| 603 |
|
| 604 |
|
| 605 |
## [0.1.4] - 2015-03-04 |
| 606 |
### Fixed |
| 607 |
- Compatible with Rust master (use wrapping ops) |
| 608 |
|
| 609 |
|
| 610 |
## [0.1.3] - 2015-02-20 |
| 611 |
### Fixed |
| 612 |
- Compatible with Rust master |
| 613 |
|
| 614 |
### Removed |
| 615 |
- Removed Copy implementations from RNGs |
| 616 |
|
| 617 |
|
| 618 |
## [0.1.2] - 2015-02-03 |
| 619 |
### Added |
| 620 |
- Imported functionality from `std::rand`, including: |
| 621 |
- `StdRng`, `SeedableRng`, `TreadRng`, `weak_rng()` |
| 622 |
- `ReaderRng`: A wrapper around any Reader to treat it as an RNG. |
| 623 |
- Imported documentation from `std::rand` |
| 624 |
- Imported tests from `std::rand` |
| 625 |
|
| 626 |
|
| 627 |
## [0.1.1] - 2015-02-03 |
| 628 |
### Added |
| 629 |
- Migrate to a cargo-compatible directory structure. |
| 630 |
|
| 631 |
### Fixed |
| 632 |
- Do not use entropy during `gen_weighted_bool(1)` |
| 633 |
|
| 634 |
|
| 635 |
## [Rust 0.12.0] - 2014-10-09 |
| 636 |
### Added |
| 637 |
- Impl Rand for tuples of arity 11 and 12 |
| 638 |
- Include ChaCha pseudorandom generator |
| 639 |
- Add `next_f64` and `next_f32` to Rng |
| 640 |
- Implement Clone for PRNGs |
| 641 |
|
| 642 |
### Changed |
| 643 |
- Rename `TaskRng` to `ThreadRng` and `task_rng` to `thread_rng` (since a |
| 644 |
runtime is removed from Rust). |
| 645 |
|
| 646 |
### Fixed |
| 647 |
- Improved performance of ISAAC and ISAAC64 by 30% and 12 % respectively, by |
| 648 |
informing the optimiser that indexing is never out-of-bounds. |
| 649 |
|
| 650 |
### Removed |
| 651 |
- Removed the Deprecated `choose_option` |
| 652 |
|
| 653 |
|
| 654 |
## [Rust 0.11.0] - 2014-07-02 |
| 655 |
### Added |
| 656 |
- document when to use `OSRng` in cryptographic context, and explain why we use `/dev/urandom` instead of `/dev/random` |
| 657 |
- `Rng::gen_iter()` which will return an infinite stream of random values |
| 658 |
- `Rng::gen_ascii_chars()` which will return an infinite stream of random ascii characters |
| 659 |
|
| 660 |
### Changed |
| 661 |
- Now only depends on libcore! |
| 662 |
- Remove `Rng.choose()`, rename `Rng.choose_option()` to `.choose()` |
| 663 |
- Rename OSRng to OsRng |
| 664 |
- The WeightedChoice structure is no longer built with a `Vec<Weighted<T>>`, |
| 665 |
but rather a `&mut [Weighted<T>]`. This means that the WeightedChoice |
| 666 |
structure now has a lifetime associated with it. |
| 667 |
- The `sample` method on `Rng` has been moved to a top-level function in the |
| 668 |
`rand` module due to its dependence on `Vec`. |
| 669 |
|
| 670 |
### Removed |
| 671 |
- `Rng::gen_vec()` was removed. Previous behavior can be regained with |
| 672 |
`rng.gen_iter().take(n).collect()` |
| 673 |
- `Rng::gen_ascii_str()` was removed. Previous behavior can be regained with |
| 674 |
`rng.gen_ascii_chars().take(n).collect()` |
| 675 |
- {IsaacRng, Isaac64Rng, XorShiftRng}::new() have all been removed. These all |
| 676 |
relied on being able to use an OSRng for seeding, but this is no longer |
| 677 |
available in librand (where these types are defined). To retain the same |
| 678 |
functionality, these types now implement the `Rand` trait so they can be |
| 679 |
generated with a random seed from another random number generator. This allows |
| 680 |
the stdlib to use an OSRng to create seeded instances of these RNGs. |
| 681 |
- Rand implementations for `Box<T>` and `@T` were removed. These seemed to be |
| 682 |
pretty rare in the codebase, and it allows for librand to not depend on |
| 683 |
liballoc. Additionally, other pointer types like Rc<T> and Arc<T> were not |
| 684 |
supported. |
| 685 |
- Remove a slew of old deprecated functions |
| 686 |
|
| 687 |
|
| 688 |
## [Rust 0.10] - 2014-04-03 |
| 689 |
### Changed |
| 690 |
- replace `Rng.shuffle's` functionality with `.shuffle_mut` |
| 691 |
- bubble up IO errors when creating an OSRng |
| 692 |
|
| 693 |
### Fixed |
| 694 |
- Use `fill()` instead of `read()` |
| 695 |
- Rewrite OsRng in Rust for windows |
| 696 |
|
| 697 |
## [0.10-pre] - 2014-03-02 |
| 698 |
### Added |
| 699 |
- Separate `rand` out of the standard library |