hcid

Crates.iohcid
lib.rshcid
version0.0.6
sourcesrc
created_at2019-02-14 21:09:21.250611
updated_at2019-05-03 21:22:39.481743
descriptionHolochain base32 encoding scheme for keys, agents, identifiers, etc
homepage
repositoryhttps://github.com/holochain/hcid
max_upload_size
id114820
size28,674
Eric Harris-Braun (zippy)

documentation

https://docs.rs/hcid

README

hcid

Holochain base32 encoding scheme for keys, agents, identifiers, etc.

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);
}
Commit count: 49

cargo fmt