Closed mitar closed 7 years ago
So I have this object:
./ipfs object get QmYe6tCaRi5M2b64uTU4ikugBQvAq2jBrwBT1rqppvNFpi
{"Links":[{"Name":"payload","Hash":"QmUxD5gZfKzm8UN4WaguAMAZjw2TzZ2ZUmcqm2qXPtais7","Size":819}],"Data":"{\"Luck\":0.4,\"Proof\":\"\u003cTEE signature\u003e\"}"}
And when I pass the same object through dagCBOR.util.cid
, I get zdpuB1gw1yXZ2cHYruevpr6GwSKPxoyfF6nsKridoYZD8LJaf
. It could be that I am doing something wrong, but it is unclear to me. Having equals
function would remove any ambiguity to me.
And I cannot do toV0().toBaseEncodedString()
because I get Cannot convert a non dag-pb CID to CIDv0
.
Oh, I found it: https://github.com/ipld/js-cid/blob/master/src/index.js#L125
But it is not documented. And it also does not compare across versions?
It considers it to be equal if they also share the version. Are you just trying to compare the multihash?
I think after I learned more this is not really reasonable. :-) Let me just close it.
Is there a way to compare two CIDs for equality of the hash itself? I am guessing that because I have a different versions of it, base encoding is different? Or is this not possible?