fn sampling_rng(len: usize) -> StdRng {
    // We use a fixed seed RNG here and hope the size will provide enough entropy to avoid gross
    // misestimations. This has the added benefit that repeated measurements will consider the
    // same nodes, reducing jitter and making this a pure function.

    // Initialize a buffer suitable for the seed, which might be larger than our length bytes.
    let mut seed = <StdRng as SeedableRng>::Seed::default();
    let len_be = len.to_be_bytes();

    // Mix in entropy from length.
    for (b1, b2) in seed.iter_mut().zip(len_be.iter()) {
        *b1 ^= *b2;
    }

    StdRng::from_seed(seed)
}
/// Creates an RNG for sampling based on the length of a collection.
Creates an RNG for sampling based on the length of a collection.
Creates an RNG for sampling based on the length of a collection .
fn sampling_rng(len: usize) -> StdRng {
    // We use a fixed seed RNG here and hope the size will provide enough entropy to avoid gross
    // misestimations. This has the added benefit that repeated measurements will consider the
    // same nodes, reducing jitter and making this a pure function.
    // Initialize a buffer suitable for the seed, which might be larger than our length bytes.
    let mut seed = <StdRng as SeedableRng>::Seed::default();
    let len_be = len.to_be_bytes();
    // Mix in entropy from length.
    for (b1, b2) in seed.iter_mut().zip(len_be.iter()) {
        *b1 ^= *b2;
    }
    StdRng::from_seed(seed)
}
fn sampling_rng ( len : usize ) -> StdRng { // We use a fixed seed RNG here and hope the size will provide enough entropy to avoid gross // misestimations. This has the added benefit that repeated measurements will consider the // same nodes, reducing jitter and making this a pure function. // Initialize a buffer suitable for the seed, which might be larger than our length bytes. let mut seed = < StdRng as SeedableRng > :: Seed :: default ( ) ; let len_be = len . to_be_bytes ( ) ; // Mix in entropy from length. for ( b1 , b2 ) in seed . iter_mut ( ) . zip ( len_be . iter ( ) ) { * b1 ^= * b2 ; } StdRng :: from_seed ( seed ) }
Creates an RNG for sampling based on the length of a collection.
Creates an RNG for sampling based on the length of a collection .
len
usize
len
usize