fn bin_string_to_u8_vec(bin_string: &String) -> Vec<u8>{
    let mut temp_byte: String = String::new();
    let mut u8_vec: Vec<u8> = Vec::new();

    for bit in bin_string.chars() {
        if temp_byte.len() == 8 {
            let u8_byte = u8::from_str_radix(temp_byte.as_str(), 2).unwrap();
            u8_vec.push(u8_byte);
            temp_byte = "".to_string();
        }
        temp_byte.push(bit);    
    }
    let u8_value = u8::from_str_radix(temp_byte.as_str(), 2).unwrap();
    u8_vec.push(u8_value);
    return u8_vec
}
//Decodes a Binary string to a Vector of u8
Decodes a Binary string to a Vector of u8
Decodes a Binary string to a Vector of u8
fn bin_string_to_u8_vec(bin_string: &String) -> Vec<u8>{
    let mut temp_byte: String = String::new();
    let mut u8_vec: Vec<u8> = Vec::new();
    for bit in bin_string.chars() {
        if temp_byte.len() == 8 {
            let u8_byte = u8::from_str_radix(temp_byte.as_str(), 2).unwrap();
            u8_vec.push(u8_byte);
            temp_byte = "".to_string();
        }
        temp_byte.push(bit);    
    }
    let u8_value = u8::from_str_radix(temp_byte.as_str(), 2).unwrap();
    u8_vec.push(u8_value);
    return u8_vec
}
fn bin_string_to_u8_vec ( bin_string : & String ) -> Vec < u8 > { let mut temp_byte : String = String :: new ( ) ; let mut u8_vec : Vec < u8 > = Vec :: new ( ) ; for bit in bin_string . chars ( ) { if temp_byte . len ( ) == 8 { let u8_byte = u8 :: from_str_radix ( temp_byte . as_str ( ) , 2 ) . unwrap ( ) ; u8_vec . push ( u8_byte ) ; temp_byte = " " . to_string ( ) ; } temp_byte . push ( bit ) ; } let u8_value = u8 :: from_str_radix ( temp_byte . as_str ( ) , 2 ) . unwrap ( ) ; u8_vec . push ( u8_value ) ; return u8_vec }
Decodes a Binary string to a Vector of u8
Decodes a Binary string to a Vector of u8
bin_string
&String
bin_string
&String