mirror of
https://github.com/chatmail/core.git
synced 2026-04-21 07:26:29 +03:00
Move keydata= wrapping from key.rs to aheader.rs
This commit is contained in:
committed by
holger krekel
parent
f1aba8115b
commit
38cddff6e9
15
src/key.rs
15
src/key.rs
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user