Lowercase hex of a digest. `digest` 0.11 dropped the `LowerHex` output.
(bytes: &[u8])
| 46 | |
| 47 | /// Lowercase hex of a digest. `digest` 0.11 dropped the `LowerHex` output. |
| 48 | fn hex(bytes: &[u8]) -> String { |
| 49 | use std::fmt::Write as _; |
| 50 | |
| 51 | let mut out = String::with_capacity(bytes.len() * 2); |
| 52 | for byte in bytes { |
| 53 | // Writing to a `String` cannot fail. |
| 54 | let _ = write!(out, "{byte:02x}"); |
| 55 | } |
| 56 | out |
| 57 | } |
| 58 | |
| 59 | /// `digest` 0.11 removed its `std::io` impls and its `std` feature, moving |
| 60 | /// them to the separate `digest-io` crate (RustCrypto/traits#1809), so |
no test coverage detected