pub fn from_slice(slice: &[u8]) -> Result<Self, SecretKeyError> {
        if slice.len() != N {
            return Err(SecretKeyError);
        }

        let mut value = [0u8; N];
        value[..N].copy_from_slice(slice);

        Ok(Self(value))
    }
/// Creates the key from the given byte slice, returning success if key created
/// or failing if the byte slice does not match the desired key length
Creates the key from the given byte slice, returning success if key created
or failing if the byte slice does not match the desired key length
Creates the key from the given byte slice returning success if key created or failing if the byte slice does not match the desired key length
pub fn from_slice(slice: &[u8]) -> Result<Self, SecretKeyError> {
        if slice.len() != N {
            return Err(SecretKeyError);
        }
        let mut value = [0u8; N];
        value[..N].copy_from_slice(slice);
        Ok(Self(value))
    }
pub fn from_slice ( slice : & [ u8 ] ) -> Result < Self , SecretKeyError > { if slice . len ( ) != N { return Err ( SecretKeyError ) ; } let mut value = [ 0u8 ; N ] ; value [ .. N ] . copy_from_slice ( slice ) ; Ok ( Self ( value ) ) }
Creates the key from the given byte slice, returning success if key created
or failing if the byte slice does not match the desired key length
Creates the key from the given byte slice returning success if key created or failing if the byte slice does not match the desired key length
slice
&[u8]