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 2026Releases
latest 60 of 92-
0.10.202 Jul 2026Release notes
Open source →Fixes
- Fix possible memory safety violation due to deserialization of
UniformCharfrom bad source (#1790)
Changes
- Document required output order of fn
partial_shuffleand apply#[must_use](#1769) - Avoid usage of
unsafein contexts where non-local memory corruption could invalidate contract (#1791)
Full Changelog: 0.10.1...0.10.2
Release notes
Open source →Fixes
- Fix possible memory safety violation due to deserialization of
UniformCharfrom bad source (#1790)
Changes
- Fix possible memory safety violation due to deserialization of
-
0.10.111 Apr 2026Release notes
Open source → -
0.10.008 Feb 2026Release notes
Open source →[0.10.0] - 2026-02-08
Changes
- The dependency on
rand_chachahas been replaced with a dependency onchacha20. This changes the implementation behindStdRng, but the output remains the same. There may be some API breakage when using the ChaCha-types directly as these are now the ones inchacha20instead ofrand_chacha(#1642). - Rename fns
IndexedRandom::choose_multiple->sample,choose_multiple_array->sample_array,choose_multiple_weighted->sample_weighted, structSliceChooseIter->IndexedSamplesand fnsIteratorRandom::choose_multiple->sample,choose_multiple_fill->sample_fill(#1632) - Use Edition 2024 and MSRV 1.85 (#1653)
- Let
Fillbe implemented for element types, not sliceable types (#1652) - Fix
OsError::raw_os_erroron UEFI targets by returningOption<usize>(#1665) - Replace fn
TryRngCore::read_adapter(..) -> RngReadAdapterwith simpler structRngReader(#1669) - Remove fns
SeedableRng::from_os_rng,try_from_os_rng(#1674) - Remove
Clonesupport forStdRng,ReseedingRng(#1677) - Use
postcardinstead ofbincodeto test the serde feature (#1693) - Avoid excessive allocation in
IteratorRandom::samplewhenamountis much larger than iterator size (#1695) - Rename
os_rng->sys_rng,OsRng->SysRng,OsError->SysError(#1697) - Rename
Rng->RngExtas upstreamrand_corehas renamedRngCore->Rng(#1717)
Additions
- Add fns
IndexedRandom::choose_iter,choose_weighted_iter(#1632) - Pub export
Xoshiro128PlusPlus,Xoshiro256PlusPlusprngs (#1649) - Pub export
ChaCha8Rng,ChaCha12Rng,ChaCha20Rngbehindchachafeature (#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
- @hpenne made their first contribution in #1642
- @usamoi made their first contribution in #1665
- @allan2 made their first contribution in #1680
- @tarcieri made their first contribution in #1683
- @valadaptive made their first contribution in #1693
- @stepancheg made their first contribution in #1695
Full Changelog: 0.9.2...0.10.0
Release notes
Open source →Changes
- The dependency on
rand_chachahas been replaced with a dependency onchacha20. This changes the implementation behindStdRng, but the output remains the same. There may be some API breakage when using the ChaCha-types directly as these are now the ones inchacha20instead ofrand_chacha(#1642). - Rename fns
IndexedRandom::choose_multiple->sample,choose_multiple_array->sample_array,choose_multiple_weighted->sample_weighted, structSliceChooseIter->IndexedSamplesand fnsIteratorRandom::choose_multiple->sample,choose_multiple_fill->sample_fill(#1632) - Use Edition 2024 and MSRV 1.85 (#1653)
- Let
Fillbe implemented for element types, not sliceable types (#1652) - Fix
OsError::raw_os_erroron UEFI targets by returningOption<usize>(#1665) - Replace fn
TryRngCore::read_adapter(..) -> RngReadAdapterwith simpler structRngReader(#1669) - Remove fns
SeedableRng::from_os_rng,try_from_os_rng(#1674) - Remove
Clonesupport forStdRng,ReseedingRng(#1677) - Use
postcardinstead ofbincodeto test the serde feature (#1693) - Avoid excessive allocation in
IteratorRandom::samplewhenamountis much larger than iterator size (#1695) - Rename
os_rng->sys_rng,OsRng->SysRng,OsError->SysError(#1697) - Rename
Rng->RngExtas upstreamrand_corehas renamedRngCore->Rng(#1717)
Additions
- Add fns
IndexedRandom::choose_iter,choose_weighted_iter(#1632) - Pub export
Xoshiro128PlusPlus,Xoshiro256PlusPlusprngs (#1649) - Pub export
ChaCha8Rng,ChaCha12Rng,ChaCha20Rngbehindchachafeature (#1659) - Fn
rand::make_rng() -> R where R: SeedableRng(#1734)
Removals
- The dependency on
-
0.10.0-rc.904 Feb 2026 pre-releaseRelease notes
Open source →@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). -
0.10.0-rc.826 Jan 2026 pre-release -
0.10.0-rc.720 Jan 2026 pre-releaseNothing published for this version
-
0.10.0-rc.604 Jan 2026 pre-releaseNothing published for this version
-
0.10.0-rc.508 Nov 2025 pre-releaseNothing published for this version
-
0.10.0-rc.104 Nov 2025 pre-releaseNothing published for this version
-
0.10.0-rc.011 Sep 2025 pre-releaseNothing published for this version
-
0.9.511 Jul 2026Release notes
Open source → -
0.9.413 Apr 2026 -
0.9.311 Apr 2026Release notes
Open source → -
0.9.220 Jul 2025Release notes
Open source →Deprecated
- Deprecate
rand::rngs::mockmodule andStepRnggenerator ([#1634])
Additions
- Enable
WeightedIndex<usize>(de)serialization ([#1646])
- Deprecate
-
0.9.117 Apr 2025Release notes
Open source →Security and unsafe
Fixes
- Fix feature
simd_supportfor recent nightly rust (#1586)
Changes
- Allow
fn rand::seq::index::sample_weightedandfn IndexedRandom::choose_multiple_weightedto return fewer thanamountresults (#1623), reverting an undocumented change ([#1382]) to the previous release.
Additions
- Fix feature
-
0.9.027 Jan 2025Release notes
Open source →Security and unsafe
- Policy: "rand is not a crypto library" (#1514)
- Remove fork-protection from
ReseedingRngandThreadRng. Instead, it is recommended to callThreadRng::reseedon fork. (#1379) - Use
zerocopyto replace someunsafecode (#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_corev0.9.0 (#1558)
Features
- Support
stdfeature withoutgetrandomorrand_chacha(#1354) - Enable feature
small_rngby default (#1455) - Remove implicit feature
rand_chacha; usestd_rnginstead. (#1473) - Rename feature
serde1toserde(#1477) - Rename feature
getrandomtoos_rng(#1537) - Add feature
thread_rng(#1547)
API changes: rand_core traits
- Add fn
RngCore::read_adapterimplementingstd::io::Read(#1267) - Add trait
CryptoBlockRng: BlockRngCore; maketrait CryptoRng: RngCore(#1273) - Add traits
TryRngCore,TryCryptoRng(#1424, #1499) - Rename
fn SeedableRng::from_rng->try_from_rngand add infallible variantfn from_rng(#1424) - Rename
fn SeedableRng::from_entropy->from_os_rngand add fallible variantfn try_from_os_rng(#1424) - Add bounds
CloneandAsRefto associated typeSeedableRng::Seed(#1491)
API changes: Rng trait and top-level fns
- Rename fn
rand::thread_rng()torand::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_iterasrandom_iter(#1305, #1500) - Rename fn
Rng::gentorandomto avoid conflict with the newgenkeyword in Rust 2024 (#1438) - Rename fns
Rng::gen_rangetorandom_range,gen_booltorandom_bool,gen_ratiotorandom_ratio(#1505) - Annotate panicking methods with
#[track_caller](#1442, #1447)
API changes: RNGs
- Fix
<SmallRng as SeedableRng>::Seedsize to 256 bits (#1455) - Remove first parameter (
rng) ofReseedingRng::new(#1533)
API changes: Sequences
- Split trait
SliceRandomintoIndexedRandom,IndexedMutRandom,SliceRandom(#1382) - Add
IndexedRandom::choose_multiple_array,index::sample_array(#1453, #1469)
API changes: Distributions: renames
- Rename module
rand::distributionstorand::distr(#1470) - Rename distribution
StandardtoStandardUniform(#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
Sizedbound onDistribution<T> for &D(#1278) - Remove impl of
Distribution<Option<T>>forStandardUniform(#1526) - Let distribution
StandardUniformsupport allNonZero*types (#1332) - Fns
{Uniform, UniformSampler}::{new, new_inclusive}return aResult(instead of potentially panicking) (#1229) - Distribution
UniformimplementsTryFrominstead ofFromfor ranges (#1229) - Add
UniformUsize(#1487) - Remove support for generating
isizeandusizevalues withStandardUniform,Uniform(except viaUniformUsize) andFilland usage as aWeightedAliasIndexweight (#1487) - Add impl
DistStringfor distributionsSlice<char>andUniform<char>(#1315) - Add fn
Slice::num_choices(#1402) - Add fn
p()for distributionBernoullito access probability (#1481)
API changes: Weighted distributions
- Add
pubmodulerand::distr::weighted, movingWeightedIndexthere (#1548) - Add trait
weighted::Weight, allowingWeightedIndexto trap overflow (#1353) - Add fns
weight, weights, total_weightto distributionWeightedIndex(#1420) - Rename enum
WeightedErrortoweighted::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::reseeddiscard remaining data from the last block generated (#1379) - Change fn
SmallRng::seed_from_u64implementation (#1203) - Allow
UniformFloat::newsamples andUniformFloat::sample_singleto yieldhigh(#1462) - Fix portability of distribution
Slice(#1469) - Make
Uniformforusizeportable viaUniformUsize(#1487) - Fix
IndexdRandom::choose_multiple_weightedfor very small seeds and optimize for large input length / low memory (#1530)
Reproducibility-breaking optimisations
- Optimize fn
sample_floyd, affecting output ofrand::seq::index::sampleandrand::seq::SliceRandom::choose_multiple(#1277) - New, faster algorithms for
IteratorRandom::chooseandchoose_stable(#1268) - New, faster algorithms for
SliceRandom::shuffleandpartial_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_inclusivefor floats (+~20% perf) (#1289)
Other optimisations
Other
- Add
Cargo.lock.msrvfile (#1275) - Reformat with
rustfmtand enforce (#1448) - Apply Clippy suggestions and enforce (#1448, #1474)
- Move all benchmarks to new
benchescrate (#1329, #1439) and migrate to Criterion (#1490)
Documentation
-
0.9.0-beta.314 Jan 2025 pre-releaseNothing published for this version
-
0.9.0-beta.130 Nov 2024 pre-releaseNothing published for this version
-
0.9.0-beta.026 Nov 2024 pre-releaseNothing published for this version
-
0.9.0-alpha.229 Jul 2024 pre-releaseNothing published for this version
-
0.9.0-alpha.118 Mar 2024 pre-releaseNothing published for this version
-
0.9.0-alpha.018 Feb 2024 pre-releaseNothing published for this version
-
0.8.711 Jul 2026Release notes
Open source → -
0.8.617 Apr 2026Release notes
Open source →What's Changed
This release back-ports a fix from v0.10. See also #1763.
Changes
- Deprecate feature
log(#1772)
- Drop the experimental
simd_supportfeature.
New Contributors
- @nwalfield made their first contribution in #1772
Full Changelog: 0.8.5...0.8.6
- Deprecate feature
-
0.8.514 Feb 2022Release notes
Open source →Fixes
- Fix build on non-32/64-bit architectures (#1144)
- Fix "min_const_gen" feature for
no_std(#1173) - Check
libc::pthread_atforkreturn value with panic on error (#1178) - More robust reseeding in case
ReseedingRngis used from a fork handler (#1178) - Fix nightly: remove unused
slice_partition_at_indexfeature (#1215) - Fix nightly +
simd_support: updatepacked_simd(#1216)
Rngs
StdRng: Switch from HC128 to ChaCha12 on emscripten (#1142). We now use ChaCha12 on all platforms.
Documentation
-
0.8.415 Jun 2021Release notes
Open source →Additions
- Use const-generics to support arrays of all sizes ([#1104])
- Implement
CloneandCopyforAlphanumeric([#1126]) - Add
Distribution::mapto derive a distribution using a closure ([#1129]) - Add
Slicedistribution ([#1107]) - Add
DistStringtrait with impls forStandardandAlphanumeric([#1133])
Other
- Reorder asserts in
Uniformfloat distributions for easier debugging of non-finite arguments ([#1094], [#1108]) - Add range overflow check in
Uniformfloat distributions ([#1108]) - Deprecate
rngs::adapter::ReadRng([#1130])
-
0.8.326 Jan 2021Release notes
Open source →Fixes
- Fix
no-std+allocbuild by gatingchoose_multiple_weightedonstd([#1088])
- Fix
-
0.8.213 Jan 2021Release notes
Open source →Fixes
- Fix panic in
UniformInt::sample_single_inclusiveandRng::gen_rangewhen providing a full integer range (eg0..=MAX) ([#1087])
- Fix panic in
-
0.8.104 Jan 2021 -
0.8.018 Dec 2020Release notes
Open source →Platform support
- The minimum supported Rust version is now 1.36 (#1011)
getrandomupdated to v0.2 (#1041)- Remove
wasm-bindgenandstdwebfeature flags. For details of WASM support, see the getrandom documentation. (#948) ReadRng::next_u32andnext_u64now use little-Endian conversion instead of native-Endian, affecting results on Big-Endian platforms (#1061)- The
nightlyfeature no longer implies thesimd_supportfeature (#1048) - Fix
simd_supportfeature to work on current nightlies (#1056)
Rngs
ThreadRngis no longerCopyto enable safe usage within thread-local destructors (#1035)gen_range(a, b)was replaced withgen_range(a..b).gen_range(a..=b)is also supported. Note thataandbcan no longer be references or SIMD types. (#744, #1003)- Replace
AsByteSliceMutwithFilland add support for[bool], [char], [f32], [f64](#940) - Restrict
rand::rngs::adaptertostd(#1027; see also [#928]) StdRng: add newstd_rngfeature 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_stableas an alternative tochoosewhich does not depend on size hints (#1057) - Improve accuracy and performance of
IteratorRandom::choose(#1059) - Implement
IntoIteratorforIndexVec, replacing theinto_itermethod (#1007) - Add value stability tests for
seqmodule (#933)
Misc
- Support
PartialEqandEqforStdRng,SmallRngandStepRng(#979) - Added a
serde1feature and added Serialize/Deserialize toUniformIntandWeightedIndex(#974) - Drop some unsafe code (#962, #963, #1011)
- Reduce packaged crate size (#983)
- Migrate to GitHub Actions from Travis+AppVeyor (#1073)
Distributions
Alphanumericsamples bytes instead of chars (#935)Uniformnow supportschar, enablingrng.gen_range('A'..='Z')(#1068)- Add
UniformSampler::sample_single_inclusive(#1003)
Weighted sampling
- Implement weighted sampling without replacement (#976, #1013)
rand::distributions::alias_method::WeightedIndexwas moved torand_distr::WeightedAliasIndex. The simpler alternativerand::distribution::WeightedIndexremains. (#945)- Improve treatment of rounding errors in
WeightedIndex::update_weights(#956) WeightedIndex: return error on NaN instead of panic (#1005)
Documentation
-
0.7.310 Jan 2020Release notes
Open source →Fixes
- The
Bernoullidistribution constructors now reports an error on NaN and ondenominator == 0. ([#925]) - Use
std::sync::Onceto 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::ErrorforBernoulliError([#919])
- The
-
0.7.216 Sep 2019Release notes
Open source →Fixes
- Fix dependency on
rand_core0.5.1 ([#890])
Additions
- Unit tests for value stability of distributions added ([#888])
- Fix dependency on
-
0.7.113 Sep 2019 withdrawnRelease notes
Open source →Yanked
This release was yanked since it depends on
rand_core::OsRngadded in 0.5.1 but specifies a dependency on version 0.5.0 ([#890]), causing broken builds when updating fromrand 0.7.0without also updatingrand_core.Fixes
- Fix
no_stdbehaviour, appropriately enable c2-chacha'sstdfeature ([#844]) allocfeature inno_stdis available since Rust 1.36 ([#856])- Fix or squelch issues from Clippy lints ([#840])
Additions
- Add a
no_stdtarget to CI to continuously evaluateno_stdstatus ([#844]) WeightedIndex: allow adjusting a sub-set of weights ([#866])
- Fix
-
0.7.028 Jun 2019Release notes
Open source →Fixes
- Fix incorrect pointer usages revealed by Miri testing (#780, #781)
- Fix (tiny!) bias in
Uniformfor 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_jittercrates (#759, #765) - Remove dependency on
winapi(#724) - Removed all
build.rsfiles (#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_core0.5.0 Errortype redesigned with new API (#800)- Move
from_entropymethod toSeedableRngand removeFromEntropy(#800) SeedableRng::from_rngis now expected to be value-stable (#815)
Standard RNGs
- OS interface moved from
rand_osto newgetrandomcrate (#765, getrandom) - Use ChaCha for
StdRngandThreadRng(#792) - Feature-gate
SmallRng(#792) ThreadRngnow supportsCopy(#758)- Deprecated
EntropyRng(#765) - Enable fork protection of
ReseedingRngwithoutstd(#724)
Distributions
- Many distributions have been moved to
rand_distr(#761) Bernoulli::newconstructor now returns aResult(#803)Distribution::sample_iteradjusted for more flexibility (#758)- Added
distributions::weighted::alias_method::WeightedIndexforO(1)sampling (#692) - Support sampling
NonZeroU*types with theStandarddistribution (#728) - Optimised
Binomialdistribution sampling (#735, #740, #752) - Optimised SIMD float sampling (#739)
Sequences
- Make results portable across 32- and 64-bit by using
u32samples forusizewhere possible (#809)
-
0.7.0-pre.227 Jun 2019 pre-releaseNothing published for this version
-
0.7.0-pre.112 Jun 2019 pre-releaseNothing published for this version
-
0.7.0-pre.006 Jun 2019 pre-releaseNothing published for this version
-
0.6.528 Jan 2019Release notes
Open source →Crates
- Update
rand_coreto 0.4 ([#703]) - Move
JitterRngto 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])
- Update
-
0.6.408 Jan 2019Release notes
Open source →Fixes
- Move wasm-bindgen shims to correct crate ([#686])
- Make
wasm32-unknown-unknowncompile but fail at run-time if missing bindings ([#686])
-
0.6.304 Jan 2019Release notes
Open source →Fixes
- Make the
stdfeature require the optionalrand_osdependency ([#675]) - Re-export the optional WASM dependencies of
rand_osfromrandto avoid breakage ([#674])
- Make the
-
0.6.204 Jan 2019Release notes
Open source →Additions
- Add
DefaultforThreadRng([#657]) - Move
rngs::OsRngtorand_ossub-crate; clean up code; use as dependency ([#643]) - Add
rand_xoshirosub-crate, plus benchmarks ([#642], [#668])
Fixes
- Fix bias in
UniformInt::sample_single([#662]) - Use
autocfginstead ofrustc_versionfor rustc version detection ([#664]) - Disable
i128andu128if thetarget_osisemscripten([#671]: work-around Emscripten limitation) - CI fixes ([#660], [#671])
Optimisations
- Optimise memory usage of
UnitCircleandUnitSphereSurfacedistributions (no PR)
- Add
-
0.6.123 Nov 2018Release notes
Open source →- Support sampling
Durationalso forno_std(only since Rust 1.25) ([#649]) - Disable default features of
libc([#647])
- Support sampling
-
0.6.014 Nov 2018Release notes
Open source →Project organisation
- Rand has moved from rust-lang-nursery to rust-random! (#578)
- Created The Rust Random Book (source)
- Update copyright and licence notices (#591, #611)
- Migrate policy documentation from the wiki (#544)
Platforms
- Add fork protection on Unix (#466)
- Added support for wasm-bindgen (#541, #559, #562, #600)
- Enable
OsRngfor powerpc64, sparc and sparc64 (#609) - Use
syscallfromlibcon Linux instead of redefining it (#629)
RNGs
- Switch
SmallRngto use PCG (#623) - Implement
Pcg32andPcg64Mcggenerators (#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
RcfromThreadRng(#615)
Sampling and distributions
- Implement
Rng.gen_ratio()andBernoulli::new_ratio()(#491) - Make
Uniformstrictly respectf32/f64high/low bounds (#477) - Allow
gen_rangeandUniformto work on non-Copytypes (#506) Uniformsupports inclusive ranges:Uniform::from(a..=b). This is automatically enabled for Rust >= 1.27. (#566)- Implement
TrustedLenandFusedIteratorforDistIter(#620)
New distributions
- Add the
Dirichletdistribution (#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
charsampling (#519) - Optimise sampling of
std::time::Duration(#583)
Sequences
- Redesign the
seqmodule (#483, #515) - Add
WeightedIndexandchoose_weighted(#518, #547) - Optimised and changed return type of the
sample_indicesfunction (#479) - Use
Iterator::size_hint()to speed upIteratorRandom::choose(#593)
SIMD
Other
- Revise CI scripts (#632, #635)
- Remove functionality already deprecated in 0.5 (#499)
- Support for
i128andu128is automatically enabled for Rust >= 1.26. This renders thei128_supportfeature obsolete. It still exists for backwards compatibility but does not have any effect. This breaks programs using Rand withi128_supporton nightlies older than Rust 1.26. (#571)
-
0.6.0-pre.102 Nov 2018 pre-releaseNothing published for this version
-
0.6.0-pre.017 Oct 2018 pre-releaseNothing published for this version
-
0.5.626 Jan 2019Nothing published for this version
-
0.5.507 Aug 2018 -
0.5.412 Jul 2018 -
0.5.327 Jun 2018Release notes
Open source →Platform support
- OpenBSD, Bitrig: fix compilation (broken in 0.5.1) ([#530])
-
0.5.220 Jun 2018Release notes
Open source →Platform support
- Hide
OsRngandJitterRngon unsupported platforms ([#512]; fixes [#503])
- Hide
-
0.5.108 Jun 2018Release notes
Open source →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
getentropylike OpenBSD. ([#484]) - Solaris: (untested) use
getrandomif 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])
-
0.5.021 May 2018Release notes
Open source →Crate features and organisation
- Minimum Rust version update: 1.22.0. (#239)
- Create a separate
rand_corecrate. (#288) - Deprecate
rand_derive. (#256) - Add
prelude(and module reorganisation). (#435) - Add
logfeature. Logging is now available inJitterRng,OsRng,EntropyRngandReseedingRng. (#246) - Add
serde1feature for some PRNGs. (#189) stdwebfeature forOsRngsupport on WASM via stdweb. (#272, #336)
Rngtrait- Split
RngintoRngCoreandRngextension trait.next_u32,next_u64andfill_bytesare now part ofRngCore. (#265) - Add
Rng::sample. (#256) - Deprecate
Rng::gen_weighted_bool. (#308) - Add
Rng::gen_bool. (#308) - Remove
Rng::next_f32andRng::next_f64. (#273) - Add optimized
Rng::fillandRng::try_fillmethods. (#247) - Deprecate
Rng::gen_iter. (#286) - Deprecate
Rng::gen_ascii_chars. (#279)
rand_corecraterandnow depends on newrand_corecrate (#288)RngCoreandSeedableRngare now part ofrand_core. (#288)- Add modules to help implementing RNGs
implandle. (#209, #228) - Add
ErrorandErrorKind. (#225) - Add
CryptoRngmarker trait. (#273) - Add
BlockRngCoretrait. (#281) - Add
BlockRngandBlockRng64wrappers to help implementations. (#281, #325) - Revise the
SeedableRngtrait. (#233) - Remove default implementations for
RngCore::next_u64andRngCore::fill_bytes. (#288) - Add
RngCore::try_fill_bytes. (#225)
Other traits and types
- Add
FromEntropytrait. (#233, #375) - Add
SmallRngwrapper. (#296) - Rewrite
ReseedingRngto only work withBlockRngCore(substantial performance improvement). (#281) - Deprecate
weak_rng. UseSmallRnginstead. (#296) - Deprecate
AsciiGenerator. (#279)
Random number generators
- Switch
StdRngandthread_rngto HC-128. (#277) StdRngmust now be created withfrom_entropyinstead ofnew- Change
thread_rngreseeding threshold to 32 MiB. (#277) - PRNGs no longer implement
Copy. (#209) Debugimplementations no longer show internals. (#209)- Implement
CloneforReseedingRng,JitterRng, OsRng`. (#383, #384) - Implement serialization for
XorShiftRng,IsaacRngandIsaac64Rngunder theserde1feature. (#189) - Implement
BlockRngCoreforChaChaCoreandHc128Core. (#281) - All PRNGs are now portable across big- and little-endian architectures. (#209)
Isaac64Rng::next_u32no longer throws away half the results. (#209)- Add
IsaacRng::new_from_u64andIsaac64Rng::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
JitterRngto 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
OsRngvia stdweb, behind thestdwebfeature. (#272, #336) - Use
getrandomon more platforms for Linux, and on Android. (#338) - Use the
SecRandomCopyBytesinterface 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) OsRngnow uses non-blocking when available. (#225)- Add
EntropyRng, which providesOsRng, but hasJitterRngas a fallback. (#235)
Distributions
- New
Distributiontrait. (#256) - Add
Distribution::sample_iterandRng::::sample_iter. (#361) - Deprecate
Rand,SampleandIndependentSampletraits. (#256) - Add a
Standarddistribution (replaces mostRandimplementations). (#256) - Add
BinomialandPoissondistributions. (#96) - Add
Bernoullidsitribution. (#411) - Add
Alphanumericdistribution. (#279) - Remove
Closed01distribution, addOpenClosed01. (#274, #420) - Rework
Rangetype, making it possible to implement it for user types. (#274) - Rename
RangetoUniform. (#395) - Add
Uniform::new_inclusivefor inclusive ranges. (#274) - Use widening multiply method for much faster integer range reduction. (#274)
Standarddistribution forcharusesUniforminternally. (#274)Standarddistribution forbooluses sign test. (#274)- Implement
Standarddistribution forWrapping<T>. (#436) - Implement
Uniformdistribution forDuration. (#427)
-
0.5.0-pre.215 May 2018 pre-releaseNothing published for this version
-
0.5.0-pre.122 Apr 2018 pre-releaseNothing published for this version
-
0.5.0-pre.027 Mar 2018 pre-releaseNothing published for this version
-
0.4.626 Jan 2019 -
0.4.509 Jan 2019 -
0.4.408 Jan 2019 withdrawnRelease notes
Open source →Version yanked due to semver-breaking change ([#688]).
Added
- SGX support
-
0.4.316 Aug 2018 -
0.4.206 Jan 2018Release notes
Open source →Changed
- Use
winapion Windows - Update for Fuchsia OS
- Remove dev-dependency on
log
- Use