prebuilt-down 0.1.3

A CLI tool for resolve prebuilt binary dependencies
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::fmt::Write;

pub trait ToHex {
    fn to_hex(&self) -> String;
}

impl ToHex for [u8] {
    /// convert a byte array into a hex string, should output a lowercased string
    fn to_hex(&self) -> String {
        let mut s = String::with_capacity(self.len() * 2);
        for &b in self {
            write!(&mut s, "{:02x}", b).unwrap();
        }
        return s;
    }
}