Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support canonicalizing cid's #59

Open
dvc94ch opened this issue May 7, 2020 · 1 comment
Open

support canonicalizing cid's #59

dvc94ch opened this issue May 7, 2020 · 1 comment

Comments

@dvc94ch
Copy link
Collaborator

dvc94ch commented May 7, 2020

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:

  • add a into_v1 or canonicalize method to Cid
  • make to_bytes_v1 public or add a to_canonical_bytes method
@vmx
Copy link
Member

vmx commented May 8, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants