pub fn from_slice(v: &[u8]) -> Result<AccountIdentifier, String> {
        // Trim this down when we reach rust 1.48
        let hex: Box<[u8; 32]> = match v.to_vec().into_boxed_slice().try_into() {
            Ok(h) => h,
            Err(_) => {
                let hex_str = hex::encode(v);
                return Err(format!(
                    "{} has a length of {} but we expected a length of 64",
                    hex_str,
                    hex_str.len()
                ));
            }
        };
        check_sum(*hex)
    }
/// Goes from the canonical format (with checksum) encoded in bytes rather
/// than hex to AccountIdentifier
Goes from the canonical format (with checksum) encoded in bytes rather
than hex to AccountIdentifier
Goes from the canonical format ( with checksum ) encoded in bytes rather than hex to AccountIdentifier
pub fn from_slice(v: &[u8]) -> Result<AccountIdentifier, String> {
        // Trim this down when we reach rust 1.48
        let hex: Box<[u8; 32]> = match v.to_vec().into_boxed_slice().try_into() {
            Ok(h) => h,
            Err(_) => {
                let hex_str = hex::encode(v);
                return Err(format!(
                    "{} has a length of {} but we expected a length of 64",
                    hex_str,
                    hex_str.len()
                ));
            }
        };
        check_sum(*hex)
    }
pub fn from_slice ( v : & [ u8 ] ) -> Result < AccountIdentifier , String > { // Trim this down when we reach rust 1.48 let hex : Box < [ u8 ; 32 ] > = match v . to_vec ( ) . into_boxed_slice ( ) . try_into ( ) { Ok ( h ) => h , Err ( _ ) => { let hex_str = hex :: encode ( v ) ; return Err ( format ! ( " " hex_str hex_str len ( ) ) ) ; } } ; check_sum ( * hex ) }
Goes from the canonical format (with checksum) encoded in bytes rather
than hex to AccountIdentifier
Goes from the canonical format ( with checksum ) encoded in bytes rather than hex to AccountIdentifier
v
&[u8]
v
&[u8]