multiformats / rust-cid

CID in rust
90 stars 49 forks source link

support canonicalizing cid's #59

Open dvc94ch opened 4 years ago

dvc94ch commented 4 years ago

for garbage collection to work the store needs to store the cid not just a multihash. also bitswap needs it for no obvious reason. the main advantage of using multihashes instead of cids would be (appart from the minuscle storage savings) that v0 and v1 cids containing the same multihash are treated the same.

Simple fixes would be:

vmx commented 4 years ago

Having a into_v1() (or to_v1(), as_v1(), I still haven't internalized the Rust API guidelines properly) sounds good, this is also what we do in other CID implementations.