diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2013-09-21 22:06:50 +1000 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2013-10-09 22:22:42 +1100 |
| commit | a2b509656ac9c0f98d89fe4ea9d2f64a6ec7047a (patch) | |
| tree | a29519d5ca973f88b13791b3140a2873c0b67285 /src/libstd/rt | |
| parent | 72bf201d61ac36f058cdea6a3487a27029fb65e6 (diff) | |
| download | rust-a2b509656ac9c0f98d89fe4ea9d2f64a6ec7047a.tar.gz rust-a2b509656ac9c0f98d89fe4ea9d2f64a6ec7047a.zip | |
std::rand: Add an implementation of ISAAC64.
This is 2x faster on 64-bit computers at generating anything larger than 32-bits. It has been verified against the canonical C implementation from the website of the creator of ISAAC64. Also, move `Rng.next` to `Rng.next_u32` and add `Rng.next_u64` to take full advantage of the wider word width; otherwise Isaac64 will always be squeezed down into a u32 wasting half the entropy and offering no advantage over the 32-bit variant.
Diffstat (limited to 'src/libstd/rt')
| -rw-r--r-- | src/libstd/rt/task.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/rt/task.rs b/src/libstd/rt/task.rs index 2d1b57cebf5..48b894f51e0 100644 --- a/src/libstd/rt/task.rs +++ b/src/libstd/rt/task.rs @@ -509,7 +509,7 @@ mod test { do run_in_newsched_task() { use rand::{rng, Rng}; let mut r = rng(); - let _ = r.next(); + let _ = r.next_u32(); } } |
