(bytes: &[u8])
| 965 | } |
| 966 | |
| 967 | fn hex_bytes(bytes: &[u8]) -> String { |
| 968 | const HEX: &[u8; 16] = b"0123456789abcdef"; |
| 969 | let mut result = String::with_capacity(bytes.len() * 2); |
| 970 | for byte in bytes { |
| 971 | result.push(HEX[(byte >> 4) as usize] as char); |
| 972 | result.push(HEX[(byte & 0x0f) as usize] as char); |
| 973 | } |
| 974 | result |
| 975 | } |