pub fn from_bytes(bytes: &[u8]) -> Result<Self> {
        if bytes.len() != NONCE_BYTES {
            return Err(Error::InvalidArgument(format!(
                "expected {} Nonce bytes, got {}",
                NONCE_BYTES,
                bytes.len()
            )));
        }

        let mut nonce = Nonce::new();
        for (dst, src) in nonce.0.iter_mut().zip(bytes.iter()) {
            *dst = *src;
        }

        Ok(nonce)
    }
/// Construct a new Nonce from raw bytes. The given byte slice must be
/// exactly NONCE_BYTES long.
Construct a new Nonce from raw bytes. The given byte slice must be
exactly NONCE_BYTES long.
Construct a new Nonce from raw bytes . The given byte slice must be exactly NONCE_BYTES long .
pub fn from_bytes(bytes: &[u8]) -> Result<Self> {
        if bytes.len() != NONCE_BYTES {
            return Err(Error::InvalidArgument(format!(
                "expected {} Nonce bytes, got {}",
                NONCE_BYTES,
                bytes.len()
            )));
        }
        let mut nonce = Nonce::new();
        for (dst, src) in nonce.0.iter_mut().zip(bytes.iter()) {
            *dst = *src;
        }
        Ok(nonce)
    }
pub fn from_bytes ( bytes : & [ u8 ] ) -> Result < Self > { if bytes . len ( ) != NONCE_BYTES { return Err ( Error :: InvalidArgument ( format ! ( " " NONCE_BYTES bytes len ( ) ) ) ) ; } let mut nonce = Nonce :: new ( ) ; for ( dst , src ) in nonce . 0 . iter_mut ( ) . zip ( bytes . iter ( ) ) { * dst = * src ; } Ok ( nonce ) }
Construct a new Nonce from raw bytes.
Construct a new Nonce from raw bytes .
bytes
&[u8]
bytes
&[u8]