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

utils.rs « src - github.com/windirstat/mft.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7024d632330c8f6e5982e0ee7227a1c20d141c80 (plain)
1
2
3
4
5
6
7
8
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()));
}