ipfs-cid
This crates provides a simple function to generate IPFS CIDs (Content Identifiers) from a slice of bytes.
Usage
Two functions are available: generate_cid and generate_cid_hash. The first
one returns the full CID object as defined in the cid crate (version 0.5.1). The second
one returns the hash only as a String.
let bytes_vector = read.unwrap;
let bytes_slice = bytes_vector.as_slice;
let cid_hash = generate_cid_hash.unwrap;
println!;
This should return
The file is accessible from IPFS at the same hash: QmUBnCzebDwZgkXp9ZkHHKQNfaeWn2Dw8p8vNz4GN4jBLa
CLI
A basic CLI is avaiable in 2.0.0. It returns v0 CID of the passed file.
Usage
$ ipfs-cid file
License
This project is licensed under
- MIT license (LICENSE or https://opensource.org/licenses/MIT)