usestd::fmt::Write;pubtraitToHex{fnto_hex(&self)-> String;}implToHex for [u8] {/// convert a byte array into a hex string, should output a lowercased string
fnto_hex(&self)-> String{letmut s =String::with_capacity(self.len()*2);for&b inself{write!(&mut s,"{:02x}", b).unwrap();}return s;}}