Move keydata= wrapping from key.rs to aheader.rs

This commit is contained in:
Alexander Krotov
2019-12-06 20:33:25 +03:00
committed by holger krekel
parent f1aba8115b
commit 38cddff6e9
2 changed files with 16 additions and 18 deletions

View File

@@ -178,20 +178,9 @@ impl Key {
}
}
pub fn to_base64(&self, break_every: usize) -> String {
pub fn to_base64(&self) -> String {
let buf = self.to_bytes();
let encoded = base64::encode(&buf);
encoded
.chars()
.enumerate()
.fold(String::new(), |mut res, (i, c)| {
if i > 0 && i % break_every == 0 {
res.push(' ')
}
res.push(c);
res
})
base64::encode(&buf)
}
pub fn to_armored_string(