pub fn to_public_key(&self) -> Result<PublicKey, Error> {
		if let Some("ban_") = self.0.get(..4) {
			if self.0.len() == 64 {
				let mut encoded_addr = String::from(self.0.get(4..56).unwrap());
				encoded_addr.insert_str(0, "1111");
				let checksum = self.0.get(56..).unwrap();
				let pkey_bytes = super::BAN_ENCODING.decode(encoded_addr.as_bytes())?;
				let derived_checksum = super::BAN_ENCODING.encode(&super::compute_address_checksum(&pkey_bytes[3..]));
				if checksum != derived_checksum {
					return Err(Error::InvalidAddress);
				}
				return Ok(super::pubkey::PublicKey(pkey_bytes[3..].try_into().expect("Not enough bytes for key")))
			}
			return Err(Error::InvalidAddressLength(self.0.len()));
		}
        Err(Error::InvalidAddress)
	}
/// Compute [PublicKey] from the Banano address
Compute [PublicKey] from the Banano address
Compute [ PublicKey ] from the Banano address
pub fn to_public_key(&self) -> Result<PublicKey, Error> {
		if let Some("ban_") = self.0.get(..4) {
			if self.0.len() == 64 {
				let mut encoded_addr = String::from(self.0.get(4..56).unwrap());
				encoded_addr.insert_str(0, "1111");
				let checksum = self.0.get(56..).unwrap();
				let pkey_bytes = super::BAN_ENCODING.decode(encoded_addr.as_bytes())?;
				let derived_checksum = super::BAN_ENCODING.encode(&super::compute_address_checksum(&pkey_bytes[3..]));
				if checksum != derived_checksum {
					return Err(Error::InvalidAddress);
				}
				return Ok(super::pubkey::PublicKey(pkey_bytes[3..].try_into().expect("Not enough bytes for key")))
			}
			return Err(Error::InvalidAddressLength(self.0.len()));
		}
        Err(Error::InvalidAddress)
	}
pub fn to_public_key ( & self ) -> Result < PublicKey , Error > { if let Some ( " " ) = self . 0 . get ( .. 4 ) { if self . 0 . len ( ) == 64 { let mut encoded_addr = String :: from ( self . 0 . get ( 4 .. 56 ) . unwrap ( ) ) ; encoded_addr . insert_str ( 0 , " " ) ; let checksum = self . 0 . get ( 56 .. ) . unwrap ( ) ; let pkey_bytes = super :: BAN_ENCODING . decode ( encoded_addr . as_bytes ( ) ) ? ; let derived_checksum = super :: BAN_ENCODING . encode ( & super :: compute_address_checksum ( & pkey_bytes [ 3 .. ] ) ) ; if checksum != derived_checksum { return Err ( Error :: InvalidAddress ) ; } return Ok ( super :: pubkey :: PublicKey ( pkey_bytes [ 3 .. ] . try_into ( ) . expect ( " " ) ) ) } return Err ( Error :: InvalidAddressLength ( self . 0 . len ( ) ) ) ; } Err ( Error :: InvalidAddress ) }
Compute [PublicKey] from the Banano address
Compute [ PublicKey ] from the Banano address
&self
&self