[][src]Struct subtle_encoding::bech32::Bech32

pub struct Bech32 { /* fields omitted */ }

Bech32 encoder/decoder

Methods

impl Bech32[src]

pub fn lower_case() -> Self[src]

Decode lower case Bech32 strings

pub fn upper_case() -> Self[src]

Decode upper case Bech32 strings

pub fn new(charset: [char; 32], separator: char) -> Self[src]

Create a Bech32 encoder with the given separator character

Panics if the separator character is invalid

pub fn separator(&self) -> char[src]

Return the separator character currently in use

pub fn encode<S, D>(&self, hrp: S, data: D) -> String where
    S: AsRef<str>,
    D: AsRef<[u8]>, 
[src]

Encode a bech32 string from a human-readable part (hrp) and binary data

pub fn decode<S>(&self, encoded: S) -> Result<(String, Vec<u8>), Error> where
    S: AsRef<str>, 
[src]

Decode a bech32 string to a human-readable part (HRP) and binary data

Trait Implementations

impl Default for Bech32[src]

Auto Trait Implementations

impl Send for Bech32

impl Sync for Bech32

Blanket Implementations

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]