pub fn sub_sec_proc(sub_sec: &SubSec) -> u8 {
    let mut rng;
    let range;
    let mut result;
    if sub_sec.is_specified {
        return sub_sec.specified_val;
    }
    rng = rand::thread_rng();
    //u16 instead of u8 because 8 bit long subsecs caused overflow
    range = 2_u16.pow(sub_sec.num_bits as u32) - 1;
    result = rng.gen_range(0..range as u8);
    while sub_sec.holes.contains(&result) {
        result = rng.gen_range(0..range as u8);
    }
    result
}
/// Process a given message format sub section
/// Returns u8 representation of generated sub section data
Process a given message format sub section
Returns u8 representation of generated sub section data
Process a given message format sub section Returns u8 representation of generated sub section data
pub fn sub_sec_proc(sub_sec: &SubSec) -> u8 {
    let mut rng;
    let range;
    let mut result;
    if sub_sec.is_specified {
        return sub_sec.specified_val;
    }
    rng = rand::thread_rng();
    //u16 instead of u8 because 8 bit long subsecs caused overflow
    range = 2_u16.pow(sub_sec.num_bits as u32) - 1;
    result = rng.gen_range(0..range as u8);
    while sub_sec.holes.contains(&result) {
        result = rng.gen_range(0..range as u8);
    }
    result
}
pub fn sub_sec_proc ( sub_sec : & SubSec ) -> u8 { let mut rng ; let range ; let mut result ; if sub_sec . is_specified { return sub_sec . specified_val ; } rng = rand :: thread_rng ( ) ; //u16 instead of u8 because 8 bit long subsecs caused overflow range = 2_u16 . pow ( sub_sec . num_bits as u32 ) - 1 ; result = rng . gen_range ( 0 .. range as u8 ) ; while sub_sec . holes . contains ( & result ) { result = rng . gen_range ( 0 .. range as u8 ) ; } result }
Process a given message format sub section
Returns u8 representation of generated sub section data
Process a given message format sub section Returns u8 representation of generated sub section data
sub_sec
&SubSec
sub_sec
&SubSec