/// Deserialize a public key from a slice
Deserialize a public key from a slice
Deserialize a public key from a slice
pub fn from_slice(data: &[u8]) -> Result<PublicKey, encode::Error> {
        let compressed: bool = match data.len() {
            33 => true,
            65 => false,
            len =>  { return Err(base58::Error::InvalidLength(len).into()); },
        };
        Ok(PublicKey {
            compressed: compressed,
            key: secp256k1::PublicKey::from_slice(data)?,
        })
    }
pub fn from_slice ( data : & [ u8 ] ) -> Result < PublicKey , encode :: Error > { let compressed : bool = match data . len ( ) { 33 => true , 65 => false , len => { return Err ( base58 :: Error :: InvalidLength ( len ) . into ( ) ) ; } , } ; Ok ( PublicKey { compressed : compressed , key : secp256k1 :: PublicKey :: from_slice ( data ) ? , } ) }
Deserialize a public key from a slice
Deserialize a public key from a slice
data
&[u8]