papaleguas 0.0.9

ACME client
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use base64ct::{Base64UrlUnpadded as Base64, Encoding};

macro_rules! add_field {
    ($n:ident, $t:ty) => {
        pub fn $n<T: Into<$t>>(self, val: T) -> Self {
            Self {
                $n: val.into(),
                ..self
            }
        }
    };
}

pub(crate) use add_field;

pub(crate) fn base64<T: AsRef<[u8]>>(data: T) -> String {
    Base64::encode_string(data.as_ref())
}