Trait chain_crypto::bech32::Bech32
source · pub trait Bech32 {
const BECH32_HRP: &'static str;
const BYTES_LEN: usize;
// Required methods
fn try_from_bech32_str(bech32_str: &str) -> Result<Self>
where Self: Sized;
fn to_bech32_str(&self) -> String;
}
Expand description
Bech32 encoding for fixed-size binary objects.
Required Associated Constants§
sourceconst BECH32_HRP: &'static str
const BECH32_HRP: &'static str
The human-readable prefix that is used to represent the the object in the Bech32 format. On decoding, the HRP of the input string is checked against this value.
Required Methods§
sourcefn try_from_bech32_str(bech32_str: &str) -> Result<Self>where
Self: Sized,
fn try_from_bech32_str(bech32_str: &str) -> Result<Self>where Self: Sized,
Decodes the object from its Bech32 string representation.
sourcefn to_bech32_str(&self) -> String
fn to_bech32_str(&self) -> String
Produces a Bech32 string format representation of the object.