[][src]Struct hcid::HcidEncoding

pub struct HcidEncoding { /* fields omitted */ }

an instance that can encode / decode a particular hcid encoding configuration

Methods

impl HcidEncoding[src]

pub fn new(config: HcidEncodingConfig) -> HcidResult<Self>[src]

create a new HcidEncoding instance from given HcidEncodingConfig

pub fn encode(&self, data: &[u8]) -> HcidResult<String>[src]

encode a string to base32 with this instance's configuration

pub fn decode(&self, data: &str) -> HcidResult<Vec<u8>>[src]

decode the data from a base32 string with this instance's configuration. Reed-Solomon can correct up to 1/2 its parity size worth of erasures (if no other errors are present).

pub fn is_corrupt(&self, data: &str) -> HcidResult<bool>[src]

a lighter-weight check to determine if a base32 string is corrupt

Auto Trait Implementations

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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.

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