fn pad_encoded_data(encoded_data: &String) -> String {
    let mut padded_encoded_data: String = String::new();
    let mut temp_padded_byte: String = "1".to_string();
    
    for bit in encoded_data.chars() {
        if temp_padded_byte.len() > 7 {
            padded_encoded_data = padded_encoded_data + temp_padded_byte.as_str();
            temp_padded_byte = "1".to_string();
            
        } 
        temp_padded_byte = temp_padded_byte + &bit.to_string();
    }
    padded_encoded_data = padded_encoded_data + temp_padded_byte.as_str();
    return padded_encoded_data;
}
//Pads a given binary string by prefixing a 1 to every 7 bits
Pads a given binary string by prefixing a 1 to every 7 bits
Pads a given binary string by prefixing a 1 to every 7 bits
fn pad_encoded_data(encoded_data: &String) -> String {
    let mut padded_encoded_data: String = String::new();
    let mut temp_padded_byte: String = "1".to_string();
    for bit in encoded_data.chars() {
        if temp_padded_byte.len() > 7 {
            padded_encoded_data = padded_encoded_data + temp_padded_byte.as_str();
            temp_padded_byte = "1".to_string();
        } 
        temp_padded_byte = temp_padded_byte + &bit.to_string();
    }
    padded_encoded_data = padded_encoded_data + temp_padded_byte.as_str();
    return padded_encoded_data;
}
fn pad_encoded_data ( encoded_data : & String ) -> String { let mut padded_encoded_data : String = String :: new ( ) ; let mut temp_padded_byte : String = " " . to_string ( ) ; for bit in encoded_data . chars ( ) { if temp_padded_byte . len ( ) > 7 { padded_encoded_data = padded_encoded_data + temp_padded_byte . as_str ( ) ; temp_padded_byte = " " . to_string ( ) ; } temp_padded_byte = temp_padded_byte + & bit . to_string ( ) ; } padded_encoded_data = padded_encoded_data + temp_padded_byte . as_str ( ) ; return padded_encoded_data ; }
Pads a given binary string by prefixing a 1 to every 7 bits
Pads a given binary string by prefixing a 1 to every 7 bits
encoded_data
&String
encoded_data
&String