(bytes: &[u8])
| 452 | // --------------------------------------------------------------------------- |
| 453 | |
| 454 | fn short_hex(bytes: &[u8]) -> String { |
| 455 | // 16 hex chars = 64 bits of entropy — enough to make a collision |
| 456 | // between two functions in the same repo astronomically unlikely. |
| 457 | let mut s = String::with_capacity(16); |
| 458 | for b in bytes.iter().take(8) { |
| 459 | let _ = write!(s, "{b:02x}"); |
| 460 | } |
| 461 | s |
| 462 | } |
| 463 | |
| 464 | fn short_sha256(s: &str) -> String { |
| 465 | let mut h = Sha256::new(); |
no test coverage detected