pub fn usize(limit: usize) -> usize {
        // calculate bucket size and amount
        let bucket_size = limit;
        let bucket_count = usize::max_value() / bucket_size;

        // calculate the number
        let mut num = [0; mem::size_of::<usize>()];
        loop {
            // generate random number
            Self::random(&mut num);
            let num = usize::from_ne_bytes(num);

            // determine if number falls into range
            if num < bucket_size * bucket_count {
                return num % bucket_size;
            }
        }
    }
// calculate a random number in the limit from 0 -> limit
calculate a random number in the limit from 0 -> limit
calculate a random number in the limit from 0 - > limit
pub fn usize(limit: usize) -> usize {
        // calculate bucket size and amount
        let bucket_size = limit;
        let bucket_count = usize::max_value() / bucket_size;
        // calculate the number
        let mut num = [0; mem::size_of::<usize>()];
        loop {
            // generate random number
            Self::random(&mut num);
            let num = usize::from_ne_bytes(num);
            // determine if number falls into range
            if num < bucket_size * bucket_count {
                return num % bucket_size;
            }
        }
    }
pub fn usize ( limit : usize ) -> usize { // calculate bucket size and amount let bucket_size = limit ; let bucket_count = usize :: max_value ( ) / bucket_size ; // calculate the number let mut num = [ 0 ; mem :: size_of :: < usize > ( ) ] ; loop { // generate random number Self :: random ( & mut num ) ; let num = usize :: from_ne_bytes ( num ) ; // determine if number falls into range if num < bucket_size * bucket_count { return num % bucket_size ; } } }
calculate a random number in the limit from 0 -> limit
calculate a random number in the limit from 0 - > limit
limit
usize