Closed ocknamo closed 3 years ago
When CID is converted from V0 to V1, should the default base be base32?
Yes. I just upgraded the package version v1.1.6 -> v1.1.7
and am experiencing this bug as well.
The bug can be avoided by specifying the base when using toString
.
new CID('QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR').toV1().toString('base32')
// → bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi
But this is breaking change so the Document or API should be fixed.
This is expected behavior – https://github.com/multiformats/js-cid/pull/146#issuecomment-868550683, conversions like this belong to useland
(new CID('QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR').toV1().toString('base32')
)
Type: Bug
In version: v1.1.7
When I change CID V0 to V1, the base become base58btc.
When v1.1.7. the converted CID object is as follow.
This is different from the documentation. https://docs.ipfs.io/concepts/content-addressing/#v0-to-v1
Perhaps this is the cause. https://github.com/multiformats/js-cid/commit/1ee726dd4446785cbd751a7d5728707c75ec33ad#diff-bfe9874d239014961b1ae4e89875a6155667db834a410aaaa2ebe3cf89820556R259
I think V1 CID of base58btc is not useful.
When CID is converted from V0 to V1, should the default base be base32?