pub fn rng_from_seed(seed: u32) -> StdRng {
        //Create RNG from the provided random seed.
        let mut random_bytes = vec![];
        //Fill the uper 28 bytes with 0s
        for _i in 0..7 {
            random_bytes.write_u32::<NativeEndian>(0).unwrap_or(());
        }
        //Write the last 4 bytes from the provided seed
        random_bytes.write_u32::<NativeEndian>(seed).unwrap_or(());

        // let randomness : Vec<usize> = random_bytes.iter().map(|v| *v as usize).collect();
        let mut randomness = [0; 32];
        randomness.copy_from_slice(random_bytes.as_slice());
        StdRng::from_seed(randomness)
    }
///Returns a random number generator seeded with the passed parameter.
Returns a random number generator seeded with the passed parameter.
Returns a random number generator seeded with the passed parameter .
pub fn rng_from_seed(seed: u32) -> StdRng {
        //Create RNG from the provided random seed.
        let mut random_bytes = vec![];
        //Fill the uper 28 bytes with 0s
        for _i in 0..7 {
            random_bytes.write_u32::<NativeEndian>(0).unwrap_or(());
        }
        //Write the last 4 bytes from the provided seed
        random_bytes.write_u32::<NativeEndian>(seed).unwrap_or(());
        // let randomness : Vec<usize> = random_bytes.iter().map(|v| *v as usize).collect();
        let mut randomness = [0; 32];
        randomness.copy_from_slice(random_bytes.as_slice());
        StdRng::from_seed(randomness)
    }
pub fn rng_from_seed ( seed : u32 ) -> StdRng { //Create RNG from the provided random seed. let mut random_bytes = vec ! [ ] ; //Fill the uper 28 bytes with 0s for _i in 0 .. 7 { random_bytes . write_u32 :: < NativeEndian > ( 0 ) . unwrap_or ( ( ) ) ; } //Write the last 4 bytes from the provided seed random_bytes . write_u32 :: < NativeEndian > ( seed ) . unwrap_or ( ( ) ) ; // let randomness : Vec<usize> = random_bytes.iter().map(|v| *v as usize).collect(); let mut randomness = [ 0 ; 32 ] ; randomness . copy_from_slice ( random_bytes . as_slice ( ) ) ; StdRng :: from_seed ( randomness ) }
Returns a random number generator seeded with the passed parameter.
Returns a random number generator seeded with the passed parameter .
seed
u32