[−][src]Struct subtle_encoding::bech32::Bech32
Bech32 encoder/decoder
Fields
charset: [char; 32]
Encoding character set
charset_inverse: [Option<u8>; 128]
Inverse alphabet used to decode
separator: char
Separator between the human readable and base32-encoded parts of a Bech32 string
Methods
impl Bech32[src]
impl Bech32pub fn lower_case() -> Self[src]
pub fn lower_case() -> SelfDecode lower case Bech32 strings
pub fn upper_case() -> Self[src]
pub fn upper_case() -> SelfDecode upper case Bech32 strings
pub fn new(charset: [char; 32], separator: char) -> Self[src]
pub fn new(charset: [char; 32], separator: char) -> SelfCreate a Bech32 encoder with the given separator character
Panics if the separator character is invalid
pub fn separator(&self) -> char[src]
pub fn separator(&self) -> charReturn 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]
pub fn encode<S, D>(&self, hrp: S, data: D) -> String where
S: AsRef<str>,
D: AsRef<[u8]>, 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]
pub fn decode<S>(&self, encoded: S) -> Result<(String, Vec<u8>), Error> where
S: AsRef<str>, Decode a bech32 string to a human-readable part (HRP) and binary data
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
🔬 This is a nightly-only experimental API. (
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>impl<T> From for T[src]
impl<T> From for Timpl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>impl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, ⓘImportant traits for &'_ mut Ifn borrow_mut(&mut self) -> &mut T[src]
ⓘImportant traits for &'_ mut I
fn borrow_mut(&mut self) -> &mut Timpl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src]
fn get_type_id(&self) -> TypeId