pub fn encode(bytes: &[u8]) -> String
Convert a byte slice to an owned hex string. If you simply need to display a byte slice as hex, use display instead, which avoids the allocation.
display