Welcome to mirror list, hosted at ThFree Co, Russian Federation.

utils.rs « src - github.com/windirstat/RustyMft.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7bda5c9dae4a914e551a89486d6d0a3a039e71af (plain)
1
2
3
4
5
6
7
8
9
10
pub fn to_hex_string(bytes: &Vec<u8>) -> String {
    let strs: Vec<String> = bytes.iter()
        .map(|b| format!("{:02X}", b))
        .collect();
    strs.join("")
}

pub fn print_buffer_as_hex(buffer: &[u8]) {
    println!("{}",to_hex_string(&buffer.to_vec()));
}