pub fn new(hint: impl AsRef<[u8]>) -> crate::Result<Self> {
        let hint = match hint.as_ref() {
            hint if hint.len() <= 24 => hint,
            _ => return Err(crate::Error::InterfaceError),
        };

        // copy hint
        let mut buf = [0; 24];
        buf[..hint.len()].copy_from_slice(hint);
        Ok(Self(buf))
    }
/// create a new random Id for hint
create a new random Id for hint
create a new random Id for hint
pub fn new(hint: impl AsRef<[u8]>) -> crate::Result<Self> {
        let hint = match hint.as_ref() {
            hint if hint.len() <= 24 => hint,
            _ => return Err(crate::Error::InterfaceError),
        };
        // copy hint
        let mut buf = [0; 24];
        buf[..hint.len()].copy_from_slice(hint);
        Ok(Self(buf))
    }
pub fn new ( hint : impl AsRef < [ u8 ] > ) -> crate :: Result < Self > { let hint = match hint . as_ref ( ) { hint if hint . len ( ) <= 24 => hint , _ => return Err ( crate :: Error :: InterfaceError ) , } ; // copy hint let mut buf = [ 0 ; 24 ] ; buf [ .. hint . len ( ) ] . copy_from_slice ( hint ) ; Ok ( Self ( buf ) ) }
create a new random Id for hint
create a new random Id for hint
hint
impl AsRef<[u8]>
hint
impl AsRef<[u8]>