MCPcopy Create free account
hub / github.com/chatmail/core / human_readable

Method human_readable

src/key.rs:590–602  ·  view source on GitHub ↗

Make a human-readable fingerprint.

(&self)

Source from the content-addressed store, hash-verified

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
605impl From<pgp::types::Fingerprint> for Fingerprint {

Callers 4

fromMethod · 0.80
get_encrinfoMethod · 0.80
decode_openpgpFunction · 0.80
get_encryption_infoMethod · 0.80

Calls 1

hexMethod · 0.80

Tested by

no test coverage detected