(bytes: &[u8], n: usize)
| 63 | } |
| 64 | |
| 65 | fn hex_encode_prefix(bytes: &[u8], n: usize) -> String { |
| 66 | use std::fmt::Write as _; |
| 67 | let mut out = String::with_capacity(n * 2); |
| 68 | for byte in bytes.iter().take(n) { |
| 69 | let _ = write!(out, "{byte:02x}"); |
| 70 | } |
| 71 | out |
| 72 | } |
| 73 | |
| 74 | #[cfg(test)] |
| 75 | mod tests { |
no outgoing calls
no test coverage detected