PackageTrack
Sign in Get early access

rand

Random number generators and other randomness functionality.

0.10.2 1.6B downloads/mo #6 most downloaded on crates.io rust-random/rand

What this package is like to depend on

Last release 1 months ago

11 Jul 2026

Ships fairly regularly

a new release about every 2 months

Nearly every release is documented

notes for 64 of 67 stable releases

2 versions withdrawn

withdrawn after publishing

12 years old

92 releases · first in 2015

15 releases in the last 12 months

see the full history below

Release timeline

92 releases · Feb 2015 to Jul 2026
2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release Withdrawn

Releases

latest 60 of 92
  1. 0.10.2 02 Jul 2026
    Release notes

    Fixes

    • Fix possible memory safety violation due to deserialization of UniformChar from bad source (#1790)

    Changes

    • Document required output order of fn partial_shuffle and apply #[must_use] (#1769)
    • Avoid usage of unsafe in contexts where non-local memory corruption could invalidate contract (#1791)

    Full Changelog: 0.10.1...0.10.2

    Open source →
    Release notes

    Fixes

    • Fix possible memory safety violation due to deserialization of UniformChar from bad source (#1790)

    Changes

    • Document required output order of fn partial_shuffle and apply #[must_use] (#1769)
    • Avoid usage of unsafe in contexts where non-local memory corruption could invalidate contract (#1791)
    Open source →
  2. 0.10.1 11 Apr 2026
    Release notes

    This release includes a fix for a soundness bug; see #1763.

    Changes

    • Document panic behavior of make_rng and add #[track_caller] (#1761)
    • Deprecate feature log (#1763)

    Full Changelog: 0.10.0...0.10.1

    Open source →
    Release notes

    This release includes a fix for a soundness bug; see #1763.

    Changes

    • Document panic behavior of make_rng and add #[track_caller] (#1761)
    • Deprecate feature log (#1763)
    Open source →
  3. 0.10.0 08 Feb 2026
    Release notes

    [0.10.0] - 2026-02-08

    Changes

    • The dependency on rand_chacha has been replaced with a dependency on chacha20. This changes the implementation behind StdRng, but the output remains the same. There may be some API breakage when using the ChaCha-types directly as these are now the ones in chacha20 instead of rand_chacha (#1642).
    • Rename fns IndexedRandom::choose_multiple -> sample, choose_multiple_array -> sample_array, choose_multiple_weighted -> sample_weighted, struct SliceChooseIter -> IndexedSamples and fns IteratorRandom::choose_multiple -> sample, choose_multiple_fill -> sample_fill (#1632)
    • Use Edition 2024 and MSRV 1.85 (#1653)
    • Let Fill be implemented for element types, not sliceable types (#1652)
    • Fix OsError::raw_os_error on UEFI targets by returning Option<usize> (#1665)
    • Replace fn TryRngCore::read_adapter(..) -> RngReadAdapter with simpler struct RngReader (#1669)
    • Remove fns SeedableRng::from_os_rng, try_from_os_rng (#1674)
    • Remove Clone support for StdRng, ReseedingRng (#1677)
    • Use postcard instead of bincode to test the serde feature (#1693)
    • Avoid excessive allocation in IteratorRandom::sample when amount is much larger than iterator size (#1695)
    • Rename os_rng -> sys_rng, OsRng -> SysRng, OsError -> SysError (#1697)
    • Rename Rng -> RngExt as upstream rand_core has renamed RngCore -> Rng (#1717)

    Additions

    • Add fns IndexedRandom::choose_iter, choose_weighted_iter (#1632)
    • Pub export Xoshiro128PlusPlus, Xoshiro256PlusPlus prngs (#1649)
    • Pub export ChaCha8Rng, ChaCha12Rng, ChaCha20Rng behind chacha feature (#1659)
    • Fn rand::make_rng() -> R where R: SeedableRng (#1734)

    Removals

    • Removed ReseedingRng (#1722)
    • Removed unused feature "nightly" (#1732)
    • Removed feature small_rng (#1732)

    New Contributors

    Full Changelog: 0.9.2...0.10.0

    Open source →
    Release notes

    Changes

    • The dependency on rand_chacha has been replaced with a dependency on chacha20. This changes the implementation behind StdRng, but the output remains the same. There may be some API breakage when using the ChaCha-types directly as these are now the ones in chacha20 instead of rand_chacha (#1642).
    • Rename fns IndexedRandom::choose_multiple -> sample, choose_multiple_array -> sample_array, choose_multiple_weighted -> sample_weighted, struct SliceChooseIter -> IndexedSamples and fns IteratorRandom::choose_multiple -> sample, choose_multiple_fill -> sample_fill (#1632)
    • Use Edition 2024 and MSRV 1.85 (#1653)
    • Let Fill be implemented for element types, not sliceable types (#1652)
    • Fix OsError::raw_os_error on UEFI targets by returning Option<usize> (#1665)
    • Replace fn TryRngCore::read_adapter(..) -> RngReadAdapter with simpler struct RngReader (#1669)
    • Remove fns SeedableRng::from_os_rng, try_from_os_rng (#1674)
    • Remove Clone support for StdRng, ReseedingRng (#1677)
    • Use postcard instead of bincode to test the serde feature (#1693)
    • Avoid excessive allocation in IteratorRandom::sample when amount is much larger than iterator size (#1695)
    • Rename os_rng -> sys_rng, OsRng -> SysRng, OsError -> SysError (#1697)
    • Rename Rng -> RngExt as upstream rand_core has renamed RngCore -> Rng (#1717)

    Additions

    • Add fns IndexedRandom::choose_iter, choose_weighted_iter (#1632)
    • Pub export Xoshiro128PlusPlus, Xoshiro256PlusPlus prngs (#1649)
    • Pub export ChaCha8Rng, ChaCha12Rng, ChaCha20Rng behind chacha feature (#1659)
    • Fn rand::make_rng() -> R where R: SeedableRng (#1734)

    Removals

    • Removed ReseedingRng (#1722)
    • Removed unused feature "nightly" (#1732)
    • Removed feature small_rng (#1732)
    Open source →
  4. 0.10.0-rc.9 04 Feb 2026 pre-release
    Release notes

    @newpavlov this includes a number of what I think are uncontroversial
    changes from my other PRs and also bumps versions to allow publishing a
    new pre-release.

    I'm not committing to keeping rand_pcg in this repo but for now this is
    the easiest approach (I also wouldn't make changes here until after
    v0.10).

    Open source →
  5. 0.10.0-rc.8 26 Jan 2026 pre-release
    Release notes

    Rename Rng => RngExt; bump rand_core to v0.10.0-rc-6 (#1717)

    Open source →
  6. 0.10.0-rc.7 20 Jan 2026 pre-release

    Nothing published for this version

  7. 0.10.0-rc.6 04 Jan 2026 pre-release

    Nothing published for this version

  8. 0.10.0-rc.5 08 Nov 2025 pre-release

    Nothing published for this version

  9. 0.10.0-rc.1 04 Nov 2025 pre-release

    Nothing published for this version

  10. 0.10.0-rc.0 11 Sep 2025 pre-release

    Nothing published for this version

  11. 0.9.5 11 Jul 2026
    Release notes

    What's Changed

    Full Changelog: 0.9.4...0.9.5

    Open source →
  12. 0.9.4 13 Apr 2026
    Release notes

    Fixes

    Full Changelog: 0.9.3...0.9.4

    Open source →
  13. 0.9.3 11 Apr 2026
    Release notes

    This release back-ports a fix from v0.10. See also [#1763].

    Changes

    • Deprecate feature log (#1764)
    • Replace usages of doc_auto_cfg (#1764)

    Full Changelog: 0.9.2...0.9.3

    Open source →
  14. 0.9.2 20 Jul 2025
    Release notes

    Deprecated

    • Deprecate rand::rngs::mock module and StepRng generator ([#1634])

    Additions

    • Enable WeightedIndex<usize> (de)serialization ([#1646])
    Open source →
  15. 0.9.1 17 Apr 2025
    Release notes

    Security and unsafe

    • Revise "not a crypto library" policy again (#1565)
    • Remove zerocopy dependency from rand (#1579)

    Fixes

    • Fix feature simd_support for recent nightly rust (#1586)

    Changes

    • Allow fn rand::seq::index::sample_weighted and fn IndexedRandom::choose_multiple_weighted to return fewer than amount results (#1623), reverting an undocumented change ([#1382]) to the previous release.

    Additions

    • Add rand::distr::Alphabetic distribution. (#1587)
    • Re-export rand_core (#1604)
    Open source →
  16. 0.9.0 27 Jan 2025
    Release notes

    Security and unsafe

    • Policy: "rand is not a crypto library" (#1514)
    • Remove fork-protection from ReseedingRng and ThreadRng. Instead, it is recommended to call ThreadRng::reseed on fork. (#1379)
    • Use zerocopy to replace some unsafe code (#1349, #1393, #1446, #1502)

    Dependencies

    • Bump the MSRV to 1.63.0 (#1207, #1246, #1269, #1341, #1416, #1536); note that 1.60.0 may work for dependents when using --ignore-rust-version
    • Update to rand_core v0.9.0 (#1558)

    Features

    • Support std feature without getrandom or rand_chacha (#1354)
    • Enable feature small_rng by default (#1455)
    • Remove implicit feature rand_chacha; use std_rng instead. (#1473)
    • Rename feature serde1 to serde (#1477)
    • Rename feature getrandom to os_rng (#1537)
    • Add feature thread_rng (#1547)

    API changes: rand_core traits

    • Add fn RngCore::read_adapter implementing std::io::Read (#1267)
    • Add trait CryptoBlockRng: BlockRngCore; make trait CryptoRng: RngCore (#1273)
    • Add traits TryRngCore, TryCryptoRng (#1424, #1499)
    • Rename fn SeedableRng::from_rng -> try_from_rng and add infallible variant fn from_rng (#1424)
    • Rename fn SeedableRng::from_entropy -> from_os_rng and add fallible variant fn try_from_os_rng (#1424)
    • Add bounds Clone and AsRef to associated type SeedableRng::Seed (#1491)

    API changes: Rng trait and top-level fns

    • Rename fn rand::thread_rng() to rand::rng() and remove from the prelude (#1506)
    • Remove fn rand::random() from the prelude (#1506)
    • Add top-level fns random_iter, random_range, random_bool, random_ratio, fill (#1488)
    • Re-introduce fn Rng::gen_iter as random_iter (#1305, #1500)
    • Rename fn Rng::gen to random to avoid conflict with the new gen keyword in Rust 2024 (#1438)
    • Rename fns Rng::gen_range to random_range, gen_bool to random_bool, gen_ratio to random_ratio (#1505)
    • Annotate panicking methods with #[track_caller] (#1442, #1447)

    API changes: RNGs

    • Fix <SmallRng as SeedableRng>::Seed size to 256 bits (#1455)
    • Remove first parameter (rng) of ReseedingRng::new (#1533)

    API changes: Sequences

    • Split trait SliceRandom into IndexedRandom, IndexedMutRandom, SliceRandom (#1382)
    • Add IndexedRandom::choose_multiple_array, index::sample_array (#1453, #1469)

    API changes: Distributions: renames

    • Rename module rand::distributions to rand::distr (#1470)
    • Rename distribution Standard to StandardUniform (#1526)
    • Move distr::Slice -> distr::slice::Choose, distr::EmptySlice -> distr::slice::Empty (#1548)
    • Rename trait distr::DistString -> distr::SampleString (#1548)
    • Rename distr::DistIter -> distr::Iter, distr::DistMap -> distr::Map (#1548)

    API changes: Distributions

    • Relax Sized bound on Distribution<T> for &D (#1278)
    • Remove impl of Distribution<Option<T>> for StandardUniform (#1526)
    • Let distribution StandardUniform support all NonZero* types (#1332)
    • Fns {Uniform, UniformSampler}::{new, new_inclusive} return a Result (instead of potentially panicking) (#1229)
    • Distribution Uniform implements TryFrom instead of From for ranges (#1229)
    • Add UniformUsize (#1487)
    • Remove support for generating isize and usize values with StandardUniform, Uniform (except via UniformUsize) and Fill and usage as a WeightedAliasIndex weight (#1487)
    • Add impl DistString for distributions Slice<char> and Uniform<char> (#1315)
    • Add fn Slice::num_choices (#1402)
    • Add fn p() for distribution Bernoulli to access probability (#1481)

    API changes: Weighted distributions

    • Add pub module rand::distr::weighted, moving WeightedIndex there (#1548)
    • Add trait weighted::Weight, allowing WeightedIndex to trap overflow (#1353)
    • Add fns weight, weights, total_weight to distribution WeightedIndex (#1420)
    • Rename enum WeightedError to weighted::Error, revising variants (#1382) and mark as #[non_exhaustive] (#1480)

    API changes: SIMD

    • Switch to std::simd, expand SIMD & docs (#1239)

    Reproducibility-breaking changes

    • Make ReseedingRng::reseed discard remaining data from the last block generated (#1379)
    • Change fn SmallRng::seed_from_u64 implementation (#1203)
    • Allow UniformFloat::new samples and UniformFloat::sample_single to yield high (#1462)
    • Fix portability of distribution Slice (#1469)
    • Make Uniform for usize portable via UniformUsize (#1487)
    • Fix IndexdRandom::choose_multiple_weighted for very small seeds and optimize for large input length / low memory (#1530)

    Reproducibility-breaking optimisations

    • Optimize fn sample_floyd, affecting output of rand::seq::index::sample and rand::seq::SliceRandom::choose_multiple (#1277)
    • New, faster algorithms for IteratorRandom::choose and choose_stable (#1268)
    • New, faster algorithms for SliceRandom::shuffle and partial_shuffle (#1272)
    • Optimize distribution Uniform: use Canon's method (single sampling) / Lemire's method (distribution sampling) for faster sampling (breaks value stability; #1287)
    • Optimize fn sample_single_inclusive for floats (+~20% perf) (#1289)

    Other optimisations

    • Improve SmallRng initialization performance (#1482)
    • Optimise SIMD widening multiply (#1247)

    Other

    • Add Cargo.lock.msrv file (#1275)
    • Reformat with rustfmt and enforce (#1448)
    • Apply Clippy suggestions and enforce (#1448, #1474)
    • Move all benchmarks to new benches crate (#1329, #1439) and migrate to Criterion (#1490)

    Documentation

    • Improve ThreadRng related docs (#1257)
    • Docs: enable experimental --generate-link-to-definition feature (#1327)
    • Better doc of crate features, use doc_auto_cfg (#1411, #1450)
    Open source →
  17. 0.9.0-beta.3 14 Jan 2025 pre-release

    Nothing published for this version

  18. 0.9.0-beta.1 30 Nov 2024 pre-release

    Nothing published for this version

  19. 0.9.0-beta.0 26 Nov 2024 pre-release

    Nothing published for this version

  20. 0.9.0-alpha.2 29 Jul 2024 pre-release

    Nothing published for this version

  21. 0.9.0-alpha.1 18 Mar 2024 pre-release

    Nothing published for this version

  22. 0.9.0-alpha.0 18 Feb 2024 pre-release

    Nothing published for this version

  23. 0.8.7 11 Jul 2026
    Release notes

    What's Changed

    Full Changelog: 0.8.6...0.8.7

    Open source →
  24. 0.8.6 17 Apr 2026
    Release notes

    What's Changed

    This release back-ports a fix from v0.10. See also #1763.

    Changes

    • Deprecate feature log (#1772)
    • Drop the experimental simd_support feature.

    New Contributors

    Full Changelog: 0.8.5...0.8.6

    Open source →
  25. 0.8.5 14 Feb 2022
    Release notes

    Fixes

    • Fix build on non-32/64-bit architectures (#1144)
    • Fix "min_const_gen" feature for no_std (#1173)
    • Check libc::pthread_atfork return value with panic on error (#1178)
    • More robust reseeding in case ReseedingRng is used from a fork handler (#1178)
    • Fix nightly: remove unused slice_partition_at_index feature (#1215)
    • Fix nightly + simd_support: update packed_simd (#1216)

    Rngs

    • StdRng: Switch from HC128 to ChaCha12 on emscripten (#1142). We now use ChaCha12 on all platforms.

    Documentation

    • Added docs about rand's use of const generics (#1150)
    • Better random chars example (#1157)
    Open source →
  26. 0.8.4 15 Jun 2021
    Release notes

    Additions

    • Use const-generics to support arrays of all sizes ([#1104])
    • Implement Clone and Copy for Alphanumeric ([#1126])
    • Add Distribution::map to derive a distribution using a closure ([#1129])
    • Add Slice distribution ([#1107])
    • Add DistString trait with impls for Standard and Alphanumeric ([#1133])

    Other

    • Reorder asserts in Uniform float distributions for easier debugging of non-finite arguments ([#1094], [#1108])
    • Add range overflow check in Uniform float distributions ([#1108])
    • Deprecate rngs::adapter::ReadRng ([#1130])
    Open source →
  27. 0.8.3 26 Jan 2021
    Release notes

    Fixes

    • Fix no-std + alloc build by gating choose_multiple_weighted on std ([#1088])
    Open source →
  28. 0.8.2 13 Jan 2021
    Release notes

    Fixes

    • Fix panic in UniformInt::sample_single_inclusive and Rng::gen_range when providing a full integer range (eg 0..=MAX) ([#1087])
    Open source →
  29. 0.8.1 04 Jan 2021
    Release notes

    Other

    • Enable all stable features in the playground ([#1081])
    Open source →
  30. 0.8.0 18 Dec 2020
    Release notes

    Platform support

    • The minimum supported Rust version is now 1.36 (#1011)
    • getrandom updated to v0.2 (#1041)
    • Remove wasm-bindgen and stdweb feature flags. For details of WASM support, see the getrandom documentation. (#948)
    • ReadRng::next_u32 and next_u64 now use little-Endian conversion instead of native-Endian, affecting results on Big-Endian platforms (#1061)
    • The nightly feature no longer implies the simd_support feature (#1048)
    • Fix simd_support feature to work on current nightlies (#1056)

    Rngs

    • ThreadRng is no longer Copy to enable safe usage within thread-local destructors (#1035)
    • gen_range(a, b) was replaced with gen_range(a..b). gen_range(a..=b) is also supported. Note that a and b can no longer be references or SIMD types. (#744, #1003)
    • Replace AsByteSliceMut with Fill and add support for [bool], [char], [f32], [f64] (#940)
    • Restrict rand::rngs::adapter to std (#1027; see also [#928])
    • StdRng: add new std_rng feature flag (enabled by default, but might need to be used if disabling default crate features) (#948)
    • StdRng: Switch from ChaCha20 to ChaCha12 for better performance (#1028)
    • SmallRng: Replace PCG algorithm with xoshiro{128,256}++ (#1038)

    Sequences

    • Add IteratorRandom::choose_stable as an alternative to choose which does not depend on size hints (#1057)
    • Improve accuracy and performance of IteratorRandom::choose (#1059)
    • Implement IntoIterator for IndexVec, replacing the into_iter method (#1007)
    • Add value stability tests for seq module (#933)

    Misc

    • Support PartialEq and Eq for StdRng, SmallRng and StepRng (#979)
    • Added a serde1 feature and added Serialize/Deserialize to UniformInt and WeightedIndex (#974)
    • Drop some unsafe code (#962, #963, #1011)
    • Reduce packaged crate size (#983)
    • Migrate to GitHub Actions from Travis+AppVeyor (#1073)

    Distributions

    • Alphanumeric samples bytes instead of chars (#935)
    • Uniform now supports char, enabling rng.gen_range('A'..='Z') (#1068)
    • Add UniformSampler::sample_single_inclusive (#1003)

    Weighted sampling

    • Implement weighted sampling without replacement (#976, #1013)
    • rand::distributions::alias_method::WeightedIndex was moved to rand_distr::WeightedAliasIndex. The simpler alternative rand::distribution::WeightedIndex remains. (#945)
    • Improve treatment of rounding errors in WeightedIndex::update_weights (#956)
    • WeightedIndex: return error on NaN instead of panic (#1005)

    Documentation

    • Document types supported by random (#994)
    • Document notes on password generation (#995)
    • Note that SmallRng may not be the best choice for performance and in some other cases (#1038)
    • Use doc(cfg) to annotate feature-gated items (#1019)
    • Adjust README (#1065)
    Open source →
  31. 0.7.3 10 Jan 2020
    Release notes

    Fixes

    • The Bernoulli distribution constructors now reports an error on NaN and on denominator == 0. ([#925])
    • Use std::sync::Once to register fork handler, avoiding possible atomicity violation ([#928])
    • Fix documentation on the precision of generated floating-point values

    Changes

    • Unix: make libc dependency optional; only use fork protection with std feature ([#928])

    Additions

    • Implement std::error::Error for BernoulliError ([#919])
    Open source →
  32. 0.7.2 16 Sep 2019
    Release notes

    Fixes

    • Fix dependency on rand_core 0.5.1 ([#890])

    Additions

    • Unit tests for value stability of distributions added ([#888])
    Open source →
  33. 0.7.1 13 Sep 2019 withdrawn
    Release notes

    Yanked

    This release was yanked since it depends on rand_core::OsRng added in 0.5.1 but specifies a dependency on version 0.5.0 ([#890]), causing broken builds when updating from rand 0.7.0 without also updating rand_core.

    Fixes

    • Fix no_std behaviour, appropriately enable c2-chacha's std feature ([#844])
    • alloc feature in no_std is available since Rust 1.36 ([#856])
    • Fix or squelch issues from Clippy lints ([#840])

    Additions

    • Add a no_std target to CI to continuously evaluate no_std status ([#844])
    • WeightedIndex: allow adjusting a sub-set of weights ([#866])
    Open source →
  34. 0.7.0 28 Jun 2019
    Release notes

    Fixes

    • Fix incorrect pointer usages revealed by Miri testing (#780, #781)
    • Fix (tiny!) bias in Uniform for 8- and 16-bit ints (#809)

    Crate

    • Bumped MSRV (min supported Rust version) to 1.32.0
    • Updated to Rust Edition 2018 (#823, #824)
    • Removed dependence on rand_xorshift, rand_isaac, rand_jitter crates (#759, #765)
    • Remove dependency on winapi (#724)
    • Removed all build.rs files (#824)
    • Removed code already deprecated in version 0.6 (#757)
    • Removed the serde1 feature (It's still available for backwards compatibility, but it does not do anything. #830)
    • Many documentation changes

    rand_core

    • Updated to rand_core 0.5.0
    • Error type redesigned with new API (#800)
    • Move from_entropy method to SeedableRng and remove FromEntropy (#800)
    • SeedableRng::from_rng is now expected to be value-stable (#815)

    Standard RNGs

    • OS interface moved from rand_os to new getrandom crate (#765, getrandom)
    • Use ChaCha for StdRng and ThreadRng (#792)
    • Feature-gate SmallRng (#792)
    • ThreadRng now supports Copy (#758)
    • Deprecated EntropyRng (#765)
    • Enable fork protection of ReseedingRng without std (#724)

    Distributions

    • Many distributions have been moved to rand_distr (#761)
    • Bernoulli::new constructor now returns a Result (#803)
    • Distribution::sample_iter adjusted for more flexibility (#758)
    • Added distributions::weighted::alias_method::WeightedIndex for O(1) sampling (#692)
    • Support sampling NonZeroU* types with the Standard distribution (#728)
    • Optimised Binomial distribution sampling (#735, #740, #752)
    • Optimised SIMD float sampling (#739)

    Sequences

    • Make results portable across 32- and 64-bit by using u32 samples for usize where possible (#809)
    Open source →
  35. 0.7.0-pre.2 27 Jun 2019 pre-release

    Nothing published for this version

  36. 0.7.0-pre.1 12 Jun 2019 pre-release

    Nothing published for this version

  37. 0.7.0-pre.0 06 Jun 2019 pre-release

    Nothing published for this version

  38. 0.6.5 28 Jan 2019
    Release notes

    Crates

    • Update rand_core to 0.4 ([#703])
    • Move JitterRng to its own crate ([#685])
    • Add a wasm-bindgen test crate ([#696])

    Platforms

    • Fuchsia: Replaced fuchsia-zircon with fuchsia-cprng

    Doc

    • Use RFC 1946 for doc links ([#691])
    • Fix some doc links and notes ([#711])
    Open source →
  39. 0.6.4 08 Jan 2019
    Release notes

    Fixes

    • Move wasm-bindgen shims to correct crate ([#686])
    • Make wasm32-unknown-unknown compile but fail at run-time if missing bindings ([#686])
    Open source →
  40. 0.6.3 04 Jan 2019
    Release notes

    Fixes

    • Make the std feature require the optional rand_os dependency ([#675])
    • Re-export the optional WASM dependencies of rand_os from rand to avoid breakage ([#674])
    Open source →
  41. 0.6.2 04 Jan 2019
    Release notes

    Additions

    • Add Default for ThreadRng ([#657])
    • Move rngs::OsRng to rand_os sub-crate; clean up code; use as dependency ([#643])
    • Add rand_xoshiro sub-crate, plus benchmarks ([#642], [#668])

    Fixes

    • Fix bias in UniformInt::sample_single ([#662])
    • Use autocfg instead of rustc_version for rustc version detection ([#664])
    • Disable i128 and u128 if the target_os is emscripten ([#671]: work-around Emscripten limitation)
    • CI fixes ([#660], [#671])

    Optimisations

    • Optimise memory usage of UnitCircle and UnitSphereSurface distributions (no PR)
    Open source →
  42. 0.6.1 23 Nov 2018
    Release notes
    • Support sampling Duration also for no_std (only since Rust 1.25) ([#649])
    • Disable default features of libc ([#647])
    Open source →
  43. 0.6.0 14 Nov 2018
    Release notes

    Project organisation

    Platforms

    • Add fork protection on Unix (#466)
    • Added support for wasm-bindgen (#541, #559, #562, #600)
    • Enable OsRng for powerpc64, sparc and sparc64 (#609)
    • Use syscall from libc on Linux instead of redefining it (#629)

    RNGs

    • Switch SmallRng to use PCG (#623)
    • Implement Pcg32 and Pcg64Mcg generators (#632)
    • Move ISAAC RNGs to a dedicated crate (#551)
    • Move Xorshift RNG to its own crate (#557)
    • Move ChaCha and HC128 RNGs to dedicated crates (#607, #636)
    • Remove usage of Rc from ThreadRng (#615)

    Sampling and distributions

    • Implement Rng.gen_ratio() and Bernoulli::new_ratio() (#491)
    • Make Uniform strictly respect f32 / f64 high/low bounds (#477)
    • Allow gen_range and Uniform to work on non-Copy types (#506)
    • Uniform supports inclusive ranges: Uniform::from(a..=b). This is automatically enabled for Rust >= 1.27. (#566)
    • Implement TrustedLen and FusedIterator for DistIter (#620)

    New distributions

    • Add the Dirichlet distribution (#485)
    • Added sampling from the unit sphere and circle (#567)
    • Implement the triangular distribution (#575)
    • Implement the Weibull distribution (#576)
    • Implement the Beta distribution (#574)

    Optimisations

    • Optimise Bernoulli::new (#500)
    • Optimise char sampling (#519)
    • Optimise sampling of std::time::Duration (#583)

    Sequences

    • Redesign the seq module (#483, #515)
    • Add WeightedIndex and choose_weighted (#518, #547)
    • Optimised and changed return type of the sample_indices function (#479)
    • Use Iterator::size_hint() to speed up IteratorRandom::choose (#593)

    SIMD

    Other

    • Revise CI scripts (#632, #635)
    • Remove functionality already deprecated in 0.5 (#499)
    • Support for i128 and u128 is automatically enabled for Rust >= 1.26. This renders the i128_support feature obsolete. It still exists for backwards compatibility but does not have any effect. This breaks programs using Rand with i128_support on nightlies older than Rust 1.26. (#571)
    Open source →
  44. 0.6.0-pre.1 02 Nov 2018 pre-release

    Nothing published for this version

  45. 0.6.0-pre.0 17 Oct 2018 pre-release

    Nothing published for this version

  46. 0.5.6 26 Jan 2019

    Nothing published for this version

  47. 0.5.5 07 Aug 2018
    Release notes

    Documentation

    • Fix links in documentation ([#582])
    Open source →
  48. 0.5.4 12 Jul 2018
    Release notes

    Platform support

    • Make OsRng work via WASM/stdweb for WebWorkers
    Open source →
  49. 0.5.3 27 Jun 2018
    Release notes

    Platform support

    • OpenBSD, Bitrig: fix compilation (broken in 0.5.1) ([#530])
    Open source →
  50. 0.5.2 20 Jun 2018
    Release notes

    Platform support

    • Hide OsRng and JitterRng on unsupported platforms ([#512]; fixes [#503])
    Open source →
  51. 0.5.1 08 Jun 2018
    Release notes

    New distributions

    • Added Cauchy distribution. ([#474], [#486])
    • Added Pareto distribution. ([#495])

    Platform support and OsRng

    • Remove blanket Unix implementation. ([#484])
    • Remove Wasm unimplemented stub. ([#484])
    • Dragonfly BSD: read from /dev/random. ([#484])
    • Bitrig: use getentropy like OpenBSD. ([#484])
    • Solaris: (untested) use getrandom if available, otherwise /dev/random. ([#484])
    • Emscripten, stdweb: split the read up in chunks. ([#484])
    • Emscripten, Haiku: don't do an extra blocking read from /dev/random. ([#484])
    • Linux, NetBSD, Solaris: read in blocking mode on first use in fill_bytes. ([#484])
    • Fuchsia, CloudABI: fix compilation (broken in Rand 0.5). ([#484])
    Open source →
  52. 0.5.0 21 May 2018
    Release notes

    Crate features and organisation

    • Minimum Rust version update: 1.22.0. (#239)
    • Create a separate rand_core crate. (#288)
    • Deprecate rand_derive. (#256)
    • Add prelude (and module reorganisation). (#435)
    • Add log feature. Logging is now available in JitterRng, OsRng, EntropyRng and ReseedingRng. (#246)
    • Add serde1 feature for some PRNGs. (#189)
    • stdweb feature for OsRng support on WASM via stdweb. (#272, #336)

    Rng trait

    • Split Rng into RngCore and Rng extension trait. next_u32, next_u64 and fill_bytes are now part of RngCore. (#265)
    • Add Rng::sample. (#256)
    • Deprecate Rng::gen_weighted_bool. (#308)
    • Add Rng::gen_bool. (#308)
    • Remove Rng::next_f32 and Rng::next_f64. (#273)
    • Add optimized Rng::fill and Rng::try_fill methods. (#247)
    • Deprecate Rng::gen_iter. (#286)
    • Deprecate Rng::gen_ascii_chars. (#279)

    rand_core crate

    • rand now depends on new rand_core crate (#288)
    • RngCore and SeedableRng are now part of rand_core. (#288)
    • Add modules to help implementing RNGs impl and le. (#209, #228)
    • Add Error and ErrorKind. (#225)
    • Add CryptoRng marker trait. (#273)
    • Add BlockRngCore trait. (#281)
    • Add BlockRng and BlockRng64 wrappers to help implementations. (#281, #325)
    • Revise the SeedableRng trait. (#233)
    • Remove default implementations for RngCore::next_u64 and RngCore::fill_bytes. (#288)
    • Add RngCore::try_fill_bytes. (#225)

    Other traits and types

    • Add FromEntropy trait. (#233, #375)
    • Add SmallRng wrapper. (#296)
    • Rewrite ReseedingRng to only work with BlockRngCore (substantial performance improvement). (#281)
    • Deprecate weak_rng. Use SmallRng instead. (#296)
    • Deprecate AsciiGenerator. (#279)

    Random number generators

    • Switch StdRng and thread_rng to HC-128. (#277)
    • StdRng must now be created with from_entropy instead of new
    • Change thread_rng reseeding threshold to 32 MiB. (#277)
    • PRNGs no longer implement Copy. (#209)
    • Debug implementations no longer show internals. (#209)
    • Implement Clone for ReseedingRng, JitterRng, OsRng`. (#383, #384)
    • Implement serialization for XorShiftRng, IsaacRng and Isaac64Rng under the serde1 feature. (#189)
    • Implement BlockRngCore for ChaChaCore and Hc128Core. (#281)
    • All PRNGs are now portable across big- and little-endian architectures. (#209)
    • Isaac64Rng::next_u32 no longer throws away half the results. (#209)
    • Add IsaacRng::new_from_u64 and Isaac64Rng::new_from_u64. (#209)
    • Add the HC-128 CSPRNG Hc128Rng. (#210)
    • Change ChaCha20 to have 64-bit counter and 64-bit stream. (#349)
    • Changes to JitterRng to get its size down from 2112 to 24 bytes. (#251)
    • Various performance improvements to all PRNGs.

    Platform support and OsRng

    • Add support for CloudABI. (#224)
    • Remove support for NaCl. (#225)
    • WASM support for OsRng via stdweb, behind the stdweb feature. (#272, #336)
    • Use getrandom on more platforms for Linux, and on Android. (#338)
    • Use the SecRandomCopyBytes interface on macOS. (#322)
    • On systems that do not have a syscall interface, only keep a single file descriptor open for OsRng. (#239)
    • On Unix, first try a single read from /dev/random, then /dev/urandom. (#338)
    • Better error handling and reporting in OsRng (using new error type). (#225)
    • OsRng now uses non-blocking when available. (#225)
    • Add EntropyRng, which provides OsRng, but has JitterRng as a fallback. (#235)

    Distributions

    • New Distribution trait. (#256)
    • Add Distribution::sample_iter and Rng::::sample_iter. (#361)
    • Deprecate Rand, Sample and IndependentSample traits. (#256)
    • Add a Standard distribution (replaces most Rand implementations). (#256)
    • Add Binomial and Poisson distributions. (#96)
    • Add Bernoulli dsitribution. (#411)
    • Add Alphanumeric distribution. (#279)
    • Remove Closed01 distribution, add OpenClosed01. (#274, #420)
    • Rework Range type, making it possible to implement it for user types. (#274)
    • Rename Range to Uniform. (#395)
    • Add Uniform::new_inclusive for inclusive ranges. (#274)
    • Use widening multiply method for much faster integer range reduction. (#274)
    • Standard distribution for char uses Uniform internally. (#274)
    • Standard distribution for bool uses sign test. (#274)
    • Implement Standard distribution for Wrapping<T>. (#436)
    • Implement Uniform distribution for Duration. (#427)
    Open source →
  53. 0.5.0-pre.2 15 May 2018 pre-release

    Nothing published for this version

  54. 0.5.0-pre.1 22 Apr 2018 pre-release

    Nothing published for this version

  55. 0.5.0-pre.0 27 Mar 2018 pre-release

    Nothing published for this version

  56. 0.4.6 26 Jan 2019
    Release notes

    Platforms

    • Fuchsia: Replaced fuchsia-zircon with fuchsia-cprng
    Open source →
  57. 0.4.5 09 Jan 2019
    Release notes

    Fixed

    • Remove dependency on default features of rand_core ([#689])
    Open source →
  58. 0.4.4 08 Jan 2019 withdrawn
    Release notes

    Version yanked due to semver-breaking change ([#688]).

    Added

    • SGX support
    Open source →
  59. 0.4.3 16 Aug 2018
    Release notes

    Fixed

    • Use correct syscall number for PowerPC ([#589])
    Open source →
  60. 0.4.2 06 Jan 2018
    Release notes

    Changed

    • Use winapi on Windows
    • Update for Fuchsia OS
    • Remove dev-dependency on log
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive