v0.2.0
What's Changed
- avoid double alloc in NewCidV1 by @mvdan in #132
- benchmark existing ways to check for
IDENTITY
CIDs by @masih in #135 - fix: remove invalid multicodec2string mappings by @lidel in #137
- sync: update CI config files by @web3-bot in #131, #136, #138
BREAKING CHANGE
Converting code to string and vice versa will no longer be done with go-cid (#137), go-multicodec should be used instead.
NOTE: old mapping was invalid, and switching to go-multicodec will change the meaning of code 0x70
and 0x71
and strings cbor
and protobuf
:
protobuf
string now correctly points at code0x50
(was0x70
, which isdag-pb
)0x70
code is mapped todag-pb
(wasprotobuf
before)
cbor
string now correctly points at code0x51
(was0x71
, which isdag-cbor
)0x71
code is now mapped todag-cbor
(wascbor
before)
Refactor guide
Old way (go-cid < 0.2.0)
cid "github.com/ipfs/go-cid"
// string → code
code := cid.Codecs["libp2p-key"]
// code → string
string := cid.CodecToStr[code]
New way (with go-multicodec)
mc "github.com/multiformats/go-multicodec"
// string → code
var mc.Code code
code.Set("libp2p-key")
// code → string
code.String()
New Contributors
Full Changelog: v0.1.0...v0.2.0