16 unstable releases (6 breaking)

0.7.0 May 26, 2021
0.6.1 Feb 18, 2021
0.6.0 Nov 17, 2020
0.5.1 May 27, 2020
0.2.1 Feb 20, 2017

#37 in Network programming

Download history 11629/week @ 2021-07-05 9933/week @ 2021-07-12 10210/week @ 2021-07-19 9987/week @ 2021-07-26 12075/week @ 2021-08-02 9377/week @ 2021-08-09 10111/week @ 2021-08-16 12055/week @ 2021-08-23 12594/week @ 2021-08-30 12702/week @ 2021-09-06 15442/week @ 2021-09-13 13899/week @ 2021-09-20 14913/week @ 2021-09-27 14340/week @ 2021-10-04 16562/week @ 2021-10-11 13432/week @ 2021-10-18

31,182 downloads per month
Used in 85 crates (10 directly)

MIT license

22KB
440 lines

rust-cid

Build Status Crates.io License Documentation Dependency Status Coverage Status

CID implementation in Rust.

Table of Contents

Install

First add this to your Cargo.toml

[dependencies]
cid = "*"
multihash = "0.10"

Then run cargo build.

Usage

use cid::{Cid, Codec, Version};
use multihash::Sha2_256;
use std::convert::TryFrom;

fn main() {
    let h = Sha2_256::digest(b"beep boop");

    let cid = Cid::new(Version::V1, Codec::DagProtobuf, h).unwrap();

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

    assert_eq!(cid, out);

    let cid_string = cid.to_string();
    /// bafybeieq5jui4j25lacwomsqgjeswwl3y5zcdrresptwgmfylxo2depppq
}

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 multiformats 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

Dependencies

~250–770KB
~18K SLoC

|p`