Documentation

rust-cid

Travis CI crates.io

CID implementation in Rust.

Table of Contents

Install

First add this to your Cargo.toml

[dependencies]
cid = "*"

Then run cargo build.

Usage

extern crate cid;
extern crate multihash;
extern crate try_from;

use multihash::Hash;
use cid::{Cid, Codec};
use try_from::TryFrom;

let h = multihash::encode(Hash::SHA2256, b"beep boop").unwrap();

let cid = Cid::new(Codec::DagProtobuf, 1, h.to_vec());

let data = cid.as_bytes();
let out = Cid::try_from(data).unwrap();

assert_eq!(cid, out);

Maintainers

Captain: @dignifiedquire.

Contribute

Contributions welcome. Please check out the issues.

Check out our contributing document for more information on how we work, and about contributing in general. Please be aware that all interactions related to ipld are subject to the IPFS Code of Conduct.

Small note: If editing the README, please conform to the standard-readme specification.

License

MIT © 2017 Friedel Ziegelmayer