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

Ability to specify known hash when adding #1957

Open
btrask opened this issue Nov 10, 2015 · 1 comment
Open

Ability to specify known hash when adding #1957

btrask opened this issue Nov 10, 2015 · 1 comment
Labels
help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature

Comments

@btrask
Copy link

btrask commented Nov 10, 2015

ipfs add should have an option that lets the user specify a hash that is known ahead of time. Then when IPFS computes the hash, if they don't match, adding should fail with an error.

This defends against corruption during adding, or lets the user detect that the file was corrupted before it was added at all (for example, a truncated download).

In theory this can also be an optimization, where if the IPFS repo already has a file with the given hash, the file doesn't need to be hashed or added at all.

This depends on the user being able to compute the hash in advance. If the file came from IPFS, then that's not a problem. Otherwise, applications need to be able to compute IPFS hashes for themselves (see #1953).

@jbenet
Copy link
Member

jbenet commented Nov 16, 2015

@btrask I like this, this is a good idea.

@whyrusleeping whyrusleeping added kind/enhancement A net-new feature or improvement to an existing feature help wanted Seeking public contribution on this issue labels Aug 23, 2016
@momack2 momack2 added this to Inbox in ipfs/go-ipfs May 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature
Projects
No open projects
Development

No branches or pull requests

3 participants