@@ -13,6 +13,7 @@ extern crate rand;
13
13
extern crate rand_isaac;
14
14
extern crate rand_chacha;
15
15
extern crate rand_hc128;
16
+ extern crate rand_pcg;
16
17
extern crate rand_xorshift;
17
18
18
19
const RAND_BENCH_N : u64 = 1000 ;
@@ -27,6 +28,7 @@ use rand::rngs::{OsRng, JitterRng, EntropyRng};
27
28
use rand_isaac:: { IsaacRng , Isaac64Rng } ;
28
29
use rand_chacha:: ChaChaRng ;
29
30
use rand_hc128:: { Hc128Rng , Hc128Core } ;
31
+ use rand_pcg:: { Lcg64Xsh32 , Mcg128Xsl64 } ;
30
32
use rand_xorshift:: XorShiftRng ;
31
33
32
34
macro_rules! gen_bytes {
@@ -47,6 +49,8 @@ macro_rules! gen_bytes {
47
49
}
48
50
49
51
gen_bytes ! ( gen_bytes_xorshift, XorShiftRng :: from_entropy( ) ) ;
52
+ gen_bytes ! ( gen_bytes_lcg64_xsh32, Lcg64Xsh32 :: from_entropy( ) ) ;
53
+ gen_bytes ! ( gen_bytes_mcg128_xsh64, Mcg128Xsl64 :: from_entropy( ) ) ;
50
54
gen_bytes ! ( gen_bytes_chacha20, ChaChaRng :: from_entropy( ) ) ;
51
55
gen_bytes ! ( gen_bytes_hc128, Hc128Rng :: from_entropy( ) ) ;
52
56
gen_bytes ! ( gen_bytes_isaac, IsaacRng :: from_entropy( ) ) ;
@@ -73,6 +77,8 @@ macro_rules! gen_uint {
73
77
}
74
78
75
79
gen_uint ! ( gen_u32_xorshift, u32 , XorShiftRng :: from_entropy( ) ) ;
80
+ gen_uint ! ( gen_u32_lcg64_xsh32, u32 , Lcg64Xsh32 :: from_entropy( ) ) ;
81
+ gen_uint ! ( gen_u32_mcg128_xsh64, u32 , Mcg128Xsl64 :: from_entropy( ) ) ;
76
82
gen_uint ! ( gen_u32_chacha20, u32 , ChaChaRng :: from_entropy( ) ) ;
77
83
gen_uint ! ( gen_u32_hc128, u32 , Hc128Rng :: from_entropy( ) ) ;
78
84
gen_uint ! ( gen_u32_isaac, u32 , IsaacRng :: from_entropy( ) ) ;
@@ -82,6 +88,8 @@ gen_uint!(gen_u32_small, u32, SmallRng::from_entropy());
82
88
gen_uint ! ( gen_u32_os, u32 , OsRng :: new( ) . unwrap( ) ) ;
83
89
84
90
gen_uint ! ( gen_u64_xorshift, u64 , XorShiftRng :: from_entropy( ) ) ;
91
+ gen_uint ! ( gen_u64_lcg64_xsh32, u64 , Lcg64Xsh32 :: from_entropy( ) ) ;
92
+ gen_uint ! ( gen_u64_mcg128_xsh64, u64 , Mcg128Xsl64 :: from_entropy( ) ) ;
85
93
gen_uint ! ( gen_u64_chacha20, u64 , ChaChaRng :: from_entropy( ) ) ;
86
94
gen_uint ! ( gen_u64_hc128, u64 , Hc128Rng :: from_entropy( ) ) ;
87
95
gen_uint ! ( gen_u64_isaac, u64 , IsaacRng :: from_entropy( ) ) ;
@@ -115,6 +123,8 @@ macro_rules! init_gen {
115
123
}
116
124
117
125
init_gen ! ( init_xorshift, XorShiftRng ) ;
126
+ init_gen ! ( init_lcg64_xsh32, Lcg64Xsh32 ) ;
127
+ init_gen ! ( init_mcg128_xsh64, Mcg128Xsl64 ) ;
118
128
init_gen ! ( init_hc128, Hc128Rng ) ;
119
129
init_gen ! ( init_isaac, IsaacRng ) ;
120
130
init_gen ! ( init_isaac64, Isaac64Rng ) ;
0 commit comments