mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-05-28 10:11:19 +00:00
* Remove the multihash patch * Integrate the multiformats crates * Fix not compiling on emscripten
rust-cid
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;
use multihash::Hash;
use cid::{Cid, Codec, Version};
let h = multihash::encode(multihash::Hash::SHA2256, b"beep boop").unwrap();
let cid = Cid::new(Codec::DagProtobuf, Version::V1, &h);
let data = cid.to_bytes();
let out = Cid::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