pub fn from_base64(key: &str) -> Result<Self, crate::InvalidKey> {
        use crate::InvalidKey;

        let mut key_bytes = [0u8; 32];
        let decoded_bytes = base64::decode(key).map_err(|_| InvalidKey)?;

        if decoded_bytes.len() != 32 {
            return Err(InvalidKey);
        }

        key_bytes.copy_from_slice(&decoded_bytes[..]);
        Ok(Self(key_bytes))
    }
/// Converts a base64 representation of the key to the raw bytes.
///
/// This can fail, as not all text input is valid base64 - in this case
/// `Err(InvalidKey)` is returned.
Converts a base64 representation of the key to the raw bytes.
This can fail, as not all text input is valid base64 - in this case
`Err(InvalidKey)` is returned.
Converts a base64 representation of the key to the raw bytes . This can fail as not all text input is valid base64 - in this case ` Err ( InvalidKey ) ` is returned .
pub fn from_base64(key: &str) -> Result<Self, crate::InvalidKey> {
        use crate::InvalidKey;
        let mut key_bytes = [0u8; 32];
        let decoded_bytes = base64::decode(key).map_err(|_| InvalidKey)?;
        if decoded_bytes.len() != 32 {
            return Err(InvalidKey);
        }
        key_bytes.copy_from_slice(&decoded_bytes[..]);
        Ok(Self(key_bytes))
    }
pub fn from_base64 ( key : & str ) -> Result < Self , crate :: InvalidKey > { use crate :: InvalidKey ; let mut key_bytes = [ 0u8 ; 32 ] ; let decoded_bytes = base64 :: decode ( key ) . map_err ( | _ | InvalidKey ) ? ; if decoded_bytes . len ( ) != 32 { return Err ( InvalidKey ) ; } key_bytes . copy_from_slice ( & decoded_bytes [ .. ] ) ; Ok ( Self ( key_bytes ) ) }
Converts a base64 representation of the key to the raw bytes.
Converts a base64 representation of the key to the raw bytes .
key
&str