Compute the lowercase-hex sha256 of `bytes`.
(bytes: &[u8])
| 309 | |
| 310 | /// Compute the lowercase-hex sha256 of `bytes`. |
| 311 | fn sha256_hex(bytes: &[u8]) -> String { |
| 312 | let mut hasher = Sha256::new(); |
| 313 | hasher.update(bytes); |
| 314 | hex_encode(&hasher.finalize()) |
| 315 | } |
| 316 | |
| 317 | /// Serialize a JSON value to bytes, mapping serialization failure to an IO error |
| 318 | /// so callers can use `?` against `std::io::Result`. |
no test coverage detected