-
Notifications
You must be signed in to change notification settings - Fork 28
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
How do I use this to create a V0 CID? #20
Comments
ipfs add --only-hash --recursive the above does exactly what I need, leaving this for someone else incase they want it take out --recursive if you don't want the hash for every file in the directory |
Did you find a way to call recursive from the API ? |
Hey man yes I did, I actually found a better way that doesn't require it as well. When you upload files to ipfs inside a folder you can type the Cid of the folder into the URL and then append /X to the end to access the file inside that folder. For example if your file is called 1.png you can do f{URL}+ "/1.png" to access it. This way you don't need to compute thousands of different CID's. |
Yes there's a $ ipfs-only-hash --help
Just enough code to calculate the IPFS hash for some data
Usage
# get the cid v1 for the file
$ ipfs-only-hash <file>
# get the cid v0 for data from stdin
$ echo "hello world" | ipfs-only-hash --cid-version 0
$ echo "hello world" | ipfs-only-hash --cid-version 0
QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o If you're using this programmatically I believe it outputs v0 CIDs by default but you can pass I'd love a PR to add directory support...or maybe fix up this one. |
It seems that the CID created is of the format V1 CID. Is it possible to instead generate a V0 CID?
The text was updated successfully, but these errors were encountered: