Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.

[WIP] refactor: use CID v1 with base32 encoding by default #21

Closed
wants to merge 3 commits into from

Conversation

alanshaw
Copy link
Contributor

@alanshaw alanshaw commented Feb 6, 2019

BREAKING CHANGE: The module now creates and returns v1 CIDs which are base32 encoded by default. Also rawLeaves is set to true by default.

refs ipfs/js-ipfs#1440

Interesting side effect - using CID v1 enables the rawLeaves option so the node sizes actually get smaller (I was expecting bigger nodes because of the extra version info in the CID of the links and didn't anticipate rawLeaves getting enabled).

refs ipfs/js-ipfs#1440

License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
@achingbrain
Copy link
Collaborator

achingbrain commented Feb 7, 2019

The CID v1 -> rawLeaves enablement is to mirror what Go does in order to generate the same hashes for a given file. I guess we need to ask ourselves if we want to continue having these sort of side-effects in the codebase.

LGTM but I'll hold off merging until multiformats/js-cid/pull/73 is in and we can remove the git url from the package.json here.

@alanshaw
Copy link
Contributor Author

Will re-submit a new PR

@alanshaw alanshaw closed this May 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants