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§

source

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.

source

const BYTES_LEN: usize

Length of the encoded binary data.

Required Methods§

source

fn try_from_bech32_str(bech32_str: &str) -> Result<Self>where Self: Sized,

Decodes the object from its Bech32 string representation.

source

fn to_bech32_str(&self) -> String

Produces a Bech32 string format representation of the object.

Implementors§

source§

impl Bech32 for Digest<Blake2b256>

source§

const BECH32_HRP: &'static str = "blake2b"

source§

const BYTES_LEN: usize = 32usize

source§

impl Bech32 for Blake2b256

source§

const BECH32_HRP: &'static str = "blake2b256"

source§

const BYTES_LEN: usize = 32usize

source§

impl<A: AsymmetricPublicKey> Bech32 for PublicKey<A>

source§

const BECH32_HRP: &'static str = A::PUBLIC_BECH32_HRP

source§

const BYTES_LEN: usize = A::PUBLIC_KEY_SIZE

source§

impl<A: SecretKeySizeStatic> Bech32 for SecretKey<A>

source§

const BECH32_HRP: &'static str = A::SECRET_BECH32_HRP

source§

const BYTES_LEN: usize = A::SECRET_KEY_SIZE

source§

impl<T> Bech32 for DigestOf<Blake2b256, T>

source§

const BECH32_HRP: &'static str = "blake2b"

source§

const BYTES_LEN: usize = 32usize

source§

impl<T, A: VerificationAlgorithm> Bech32 for Signature<T, A>

source§

const BECH32_HRP: &'static str = A::SIGNATURE_BECH32_HRP

source§

const BYTES_LEN: usize = A::SIGNATURE_SIZE