summary refs log tree commit diff
path: root/src/libstd/rand/reseeding.rs
AgeCommit message (Collapse)AuthorLines
2014-01-07stdtest: Fix all leaked trait importsAlex Crichton-3/+1
2014-01-07std: Fill in all missing importsAlex Crichton-1/+2
Fallout from the previous commits
2013-10-31Fix infinite recursion in `fill_bytes()`Robert Irelan-1/+21
Fix the implementation of `std::rand::Rng::fill_bytes()` for `std::rand::reseeding::ReseedingRng` to call the `fill_bytes()` method of the underlying RNG rather than itself, which causes infinite recursion. Fixes #10202.
2013-10-09std::rand::reseeding: seed the reseeder in the SeedableRng impl.Huon Wilson-10/+12
This stops us relying on Default here.
2013-10-09std::rand: documentation additions & fixes.Huon Wilson-0/+25
2013-10-09std::rand: add & split some tests.Huon Wilson-1/+31
2013-10-09std::rand: improve the task_rng code.Huon Wilson-1/+18
It now: - can be explicitly seeded from user code (`seed_task_rng`) or from the environment (`RUST_SEED`, a positive integer) - automatically reseeds itself from the OS *unless* it was seeded by either method above - has more documentation
2013-10-09std::rand: Add a trait for seeding RNGs: SeedableRng.Huon Wilson-1/+3
This provides 2 methods: .reseed() and ::from_seed that modify and create respecitively. Implement this trait for the RNGs in the stdlib for which this makes sense.
2013-10-09std::rand: Add ReseedingRng, which will reseed an RNG after it generates a ↵Huon Wilson-0/+128
certain number of bytes. It is an "RNG adaptor" and so any RNG can be wrapped to have this behaviour.