[−][src]Struct hcid::HcidEncoding
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 with_kind(kind: &str) -> HcidResult<Self>
[src]
create a new config given a kind token string
Example
extern crate hcid; let hca0 = hcid::HcidEncoding::with_kind("hca0").unwrap(); let hck0 = hcid::HcidEncoding::with_kind("hck0").unwrap(); let hcs0 = hcid::HcidEncoding::with_kind("hcs0").unwrap();
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
impl Send for HcidEncoding
impl Sync for HcidEncoding
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,