/// Encode a set of claims and sign with HMAC-SHA256.
Encode a set of claims and sign with HMAC-SHA256.
Encode a set of claims and sign with HMAC - SHA256 .
pub fn encode(claims: &Claims, key: &[u8]) -> String {
        encode_generic(claims, HEADER.to_string(), |input| {
            let mut hmac = crypto::hmac::HMAC(crypto::hash::HashType::SHA256, key);
            hmac.update(input);
            hmac.finalize()
        })
    }
pub fn encode ( claims : & Claims , key : & [ u8 ] ) -> String { encode_generic ( claims , HEADER . to_string ( ) , | input | { let mut hmac = crypto :: hmac :: HMAC ( crypto :: hash :: HashType :: SHA256 , key ) ; hmac . update ( input ) ; hmac . finalize ( ) } ) }
Encode a set of claims and sign with HMAC-SHA256.
Encode a set of claims and sign with HMAC - SHA256 .
claims
&Claims
key
&[u8]