1 #[cfg(not(feature = "fuzztarget"))]
3 use rand::{thread_rng,Rng};
4 use bitcoin::util::uint::Uint256;
6 pub fn fill_bytes(data: &mut [u8]) {
7 let mut rng = thread_rng();
11 pub fn rand_uint256() -> Uint256 {
12 let mut rng = thread_rng();
13 Uint256([rng.gen(), rng.gen(), rng.gen(), rng.gen()])
16 pub fn rand_f32() -> f32 {
17 let mut rng = thread_rng();
21 #[cfg(not(feature = "fuzztarget"))]
22 pub use self::real_rng::*;
24 #[cfg(feature = "fuzztarget")]
26 use bitcoin::util::uint::Uint256;
28 pub fn fill_bytes(data: &mut [u8]) {
29 for i in 0..data.len() {
34 pub fn rand_uint256() -> Uint256 {
35 Uint256([0xdeadbeef, 0x1badcafe, 0xbadbeef, 0xdeadcafe])
38 pub fn rand_f32() -> f32 {
42 #[cfg(feature = "fuzztarget")]
43 pub use self::fuzzy_rng::*;