-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: Add support for specifying hash algorithms in files.add #1308
feat: Add support for specifying hash algorithms in files.add #1308
Conversation
'keccak-256', | ||
'keccak-384', | ||
'keccak-512' | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vasco-santos good enough :)
const runOnAndOff = require('../utils/on-and-off') | ||
|
||
// TODO: Test against all algorithms Object.keys(mh.names) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need :)
Hey @vasco-santos. I've been working with this this weekend and have run into a few pieces that I'd love your thoughts on: go/js ipfs hash differences: We can request the specific DAGNode if we know it's hash but it's not possible to traverse the DAGLinks of something added with a non-default algorithm. Seems like IPLD isn't aware that the links are of a different alg, they may be casting all hashes to Do you know what's wrong here? Wanted to run this by you before creating an issue. |
Hey @JonKrone Thanks for reaching out. I tested across encoding + decoding and it seemed good. However, I tested your example, as well as using other hash algorithms, but the problem persists. At a first sight, your suggestion seems to be the problem. Would you mind to create the issue and verify it? |
Since PR 1005 has been blocked for a while, I went through it.
As the PR origin is from an external organization, I created a new branch instead of rebasing it in its origin. Shortly, I got the @alanshaw (thanks :D ) implementation with
js-ipfs
master branch and made a few changes, as a consequence of the modifications that occurred meanwhile incomponents/objects
, as well as inresources
and a minor refactor.Finally, I added tests for several hash algorithms, since there are more than 300. Should I add more to the tests?