@@ -32,7 +32,7 @@ after generating 32 KiB of random data.
32
32
# Cryptographic security
33
33
34
34
An application that requires an entropy source for cryptographic purposes
35
- must use `OSRng `, which reads randomness from the source that the operating
35
+ must use `OsRng `, which reads randomness from the source that the operating
36
36
system provides (e.g. `/dev/urandom` on Unixes or `CryptGenRandom()` on Windows).
37
37
The other random number generators provided by this module are not suitable
38
38
for such purposes.
@@ -91,7 +91,7 @@ use IsaacWordRng = core_rand::Isaac64Rng;
91
91
pub use core_rand:: { Rand , Rng , SeedableRng , Open01 , Closed01 } ;
92
92
pub use core_rand:: { XorShiftRng , IsaacRng , Isaac64Rng } ;
93
93
pub use core_rand:: { distributions, reseeding} ;
94
- pub use rand:: os:: OSRng ;
94
+ pub use rand:: os:: OsRng ;
95
95
96
96
pub mod os;
97
97
pub mod reader;
@@ -113,7 +113,7 @@ impl StdRng {
113
113
/// Reading the randomness from the OS may fail, and any error is
114
114
/// propagated via the `IoResult` return value.
115
115
pub fn new ( ) -> IoResult < StdRng > {
116
- OSRng :: new ( ) . map ( |mut r| StdRng { rng : r. gen ( ) } )
116
+ OsRng :: new ( ) . map ( |mut r| StdRng { rng : r. gen ( ) } )
117
117
}
118
118
}
119
119
@@ -151,7 +151,7 @@ impl<'a> SeedableRng<&'a [uint]> for StdRng {
151
151
/// This will read randomness from the operating system to seed the
152
152
/// generator.
153
153
pub fn weak_rng ( ) -> XorShiftRng {
154
- match OSRng :: new ( ) {
154
+ match OsRng :: new ( ) {
155
155
Ok ( mut r) => r. gen ( ) ,
156
156
Err ( e) => fail ! ( "weak_rng: failed to create seeded RNG: {}" , e)
157
157
}
@@ -467,12 +467,12 @@ mod bench {
467
467
468
468
use self :: test:: Bencher ;
469
469
use super :: { XorShiftRng , StdRng , IsaacRng , Isaac64Rng , Rng , RAND_BENCH_N } ;
470
- use super :: { OSRng , weak_rng} ;
470
+ use super :: { OsRng , weak_rng} ;
471
471
use mem:: size_of;
472
472
473
473
#[ bench]
474
474
fn rand_xorshift ( b : & mut Bencher ) {
475
- let mut rng: XorShiftRng = OSRng :: new ( ) . unwrap ( ) . gen ( ) ;
475
+ let mut rng: XorShiftRng = OsRng :: new ( ) . unwrap ( ) . gen ( ) ;
476
476
b. iter ( || {
477
477
for _ in range ( 0 , RAND_BENCH_N ) {
478
478
rng. gen :: < uint > ( ) ;
@@ -483,7 +483,7 @@ mod bench {
483
483
484
484
#[ bench]
485
485
fn rand_isaac ( b : & mut Bencher ) {
486
- let mut rng: IsaacRng = OSRng :: new ( ) . unwrap ( ) . gen ( ) ;
486
+ let mut rng: IsaacRng = OsRng :: new ( ) . unwrap ( ) . gen ( ) ;
487
487
b. iter ( || {
488
488
for _ in range ( 0 , RAND_BENCH_N ) {
489
489
rng. gen :: < uint > ( ) ;
@@ -494,7 +494,7 @@ mod bench {
494
494
495
495
#[ bench]
496
496
fn rand_isaac64 ( b : & mut Bencher ) {
497
- let mut rng: Isaac64Rng = OSRng :: new ( ) . unwrap ( ) . gen ( ) ;
497
+ let mut rng: Isaac64Rng = OsRng :: new ( ) . unwrap ( ) . gen ( ) ;
498
498
b. iter ( || {
499
499
for _ in range ( 0 , RAND_BENCH_N ) {
500
500
rng. gen :: < uint > ( ) ;
0 commit comments