[][src]Crate hcid

Holochain HCID base32 encoding utility.

Example

extern crate hcid;

fn main() {
    let enc = hcid::HcidEncoding::with_kind("hcs0").unwrap();
    let key = enc.encode(&[0; 32]).unwrap();
    assert_eq!("HcSciaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", key);
    let buffer = enc.decode(&key).unwrap();
    assert_eq!([0; 32].to_vec(), buffer);
}

Structs

HcidEncoding

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

HcidEncodingConfig

represents an encoding configuration for hcid rendering and parsing

HcidError

a simple struct(String) for reporting hcid errors

Type Definitions

HcidResult

hcid Result type