alanshaw / ipfs-only-hash

#️⃣ Just enough code to calculate the IPFS hash for some data
MIT License
135 stars 28 forks source link

feat(cli.js): add rawLeaves option defaults to true to create consistent CID with go-ipfs #22

Closed shc261392 closed 2 years ago

shc261392 commented 2 years ago

Problem to address

When using the official go-ipfs CLI or API, setting CID to v1 would set the --raw-leaves option defaults to true, as discussed in https://github.com/ipfs/go-ipfs/issues/4188. It seems to me it would be better if the ipfs-only-hash CLI could have the same behavior as the current official CLI: the --raw-leaves option be defaulted to true if using v1 CID while it could still be overridden by specifying --raw-leaves false.

Breaking Change

Set rawLeaves options to true by default, so the default CIDv1 created will be different.