I need to convert &[u8] to a hex representation. For example [ A9, 45, FF, 00 ... ].
&[u8]
[ A9, 45, FF, 00 ... ]
The trait std::fmt::UpperHex is not i
std::fmt::UpperHex
There's a crate for this: hex-slice.
For example:
extern crate hex_slice; use hex_slice::AsHex; fn main() { let foo = vec![0u32, 1, 2 ,3]; println!("{:02x}", foo.as_hex()); }