pub fn escape_binary_data(value: &[u8]) -> String {
    let mut result: String = String::with_capacity(value.len());
    for v in value {
        for ch in std::ascii::escape_default(*v) {
            result.push(ch as char);
        }
    }
    result
}
///use std::ascii::escape_default to create printable string from binary data
///it keeps printable asciii characters and escapes non-printable ones
use std::ascii::escape_default to create printable string from binary data
it keeps printable asciii characters and escapes non-printable ones
use std :: ascii :: escape_default to create printable string from binary data it keeps printable asciii characters and escapes non - printable ones
pub fn escape_binary_data(value: &[u8]) -> String {
    let mut result: String = String::with_capacity(value.len());
    for v in value {
        for ch in std::ascii::escape_default(*v) {
            result.push(ch as char);
        }
    }
    result
}
pub fn escape_binary_data ( value : & [ u8 ] ) -> String { let mut result : String = String :: with_capacity ( value . len ( ) ) ; for v in value { for ch in std :: ascii :: escape_default ( * v ) { result . push ( ch as char ) ; } } result }
use std::ascii::escape_default to create printable string from binary data
it keeps printable asciii characters and escapes non-printable ones
use std :: ascii :: escape_default to create printable string from binary data it keeps printable asciii characters and escapes non - printable ones
value
&[u8]
value
&[u8]