Skip to content

Commit

Permalink
SeedableRng docs: add note on (lack of) reproducibility (#1572)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhardy authored Jan 31, 2025
1 parent c01aee7 commit bfd1826
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rand_core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,13 @@ impl<R: TryCryptoRng> CryptoRng for UnwrapErr<R> {}
/// This trait encapsulates the low-level functionality common to all
/// pseudo-random number generators (PRNGs, or algorithmic generators).
///
/// A generator implementing `SeedableRng` will usually be deterministic, but
/// beware that portability and reproducibility of results **is not implied**.
/// Refer to documentation of the generator, noting that generators named after
/// a specific algorithm are usually tested for reproducibility against a
/// reference vector, while `SmallRng` and `StdRng` specifically opt out of
/// reproducibility guarantees.
///
/// [`rand`]: https://docs.rs/rand
pub trait SeedableRng: Sized {
/// Seed type, which is restricted to types mutably-dereferenceable as `u8`
Expand Down

0 comments on commit bfd1826

Please sign in to comment.