Make a human-readable fingerprint.
(&self)
| 588 | |
| 589 | /// Make a human-readable fingerprint. |
| 590 | pub fn human_readable(&self) -> String { |
| 591 | let mut f = String::new(); |
| 592 | // Split key into chunks of 4 with space and newline at 20 chars |
| 593 | for (i, c) in self.hex().chars().enumerate() { |
| 594 | if i > 0 && i % 20 == 0 { |
| 595 | writeln!(&mut f).ok(); |
| 596 | } else if i > 0 && i % 4 == 0 { |
| 597 | write!(&mut f, " ").ok(); |
| 598 | } |
| 599 | write!(&mut f, "{c}").ok(); |
| 600 | } |
| 601 | f |
| 602 | } |
| 603 | } |
| 604 | |
| 605 | impl From<pgp::types::Fingerprint> for Fingerprint { |
no test coverage detected