fn token_to_cipher(token: &[u8]) -> Result<(box_::Nonce, &[u8]), TokenError> {
        // prevents panic on slice because of short length
        if token.len() <= NONCE_SIZE {
            return Err(TokenError::TokenMalformed);
        }

        // extract nonce bytes from token and turn into Nonce structure
        let nonce_bytes = &token[0..NONCE_SIZE];
        let nonce = box_::Nonce::from_slice(nonce_bytes).ok_or(TokenError::NonceMalformed)?;

        Ok((nonce, &token[NONCE_SIZE..]))
    }
/// Parse ciphertext and nonce bytes from provided token bytes.
Parse ciphertext and nonce bytes from provided token bytes.
Parse ciphertext and nonce bytes from provided token bytes .
fn token_to_cipher(token: &[u8]) -> Result<(box_::Nonce, &[u8]), TokenError> {
        // prevents panic on slice because of short length
        if token.len() <= NONCE_SIZE {
            return Err(TokenError::TokenMalformed);
        }
        // extract nonce bytes from token and turn into Nonce structure
        let nonce_bytes = &token[0..NONCE_SIZE];
        let nonce = box_::Nonce::from_slice(nonce_bytes).ok_or(TokenError::NonceMalformed)?;
        Ok((nonce, &token[NONCE_SIZE..]))
    }
fn token_to_cipher ( token : & [ u8 ] ) -> Result < ( box_ :: Nonce , & [ u8 ] ) , TokenError > { // prevents panic on slice because of short length if token . len ( ) <= NONCE_SIZE { return Err ( TokenError :: TokenMalformed ) ; } // extract nonce bytes from token and turn into Nonce structure let nonce_bytes = & token [ 0 .. NONCE_SIZE ] ; let nonce = box_ :: Nonce :: from_slice ( nonce_bytes ) . ok_or ( TokenError :: NonceMalformed ) ? ; Ok ( ( nonce , & token [ NONCE_SIZE .. ] ) ) }
Parse ciphertext and nonce bytes from provided token bytes.
Parse ciphertext and nonce bytes from provided token bytes .
token
&[u8]