ipfs-inactive / js-ipfs-unixfs-importer

[ARCHIVED] JavaScript implementation of the UnixFs importer used by IPFS
MIT License
5 stars 4 forks source link

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

Closed alanshaw closed 5 years ago

alanshaw commented 5 years ago

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 https://github.com/ipfs/js-ipfs/issues/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).

achingbrain commented 5 years ago

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 commented 5 years ago

Will re-submit a new PR