fix: remove invalid multicodec2string mappings (#137)

* refactor: remove Codecs table
* chore: go-cid 0.2.0

Codec table was missing dag-json and it had invalid code for dag-cbor.
It also had invalid string representation of dag-pb -- it was using
'protobuf' which is a totally different code.

This removes invalid mappings entirely.
https://github.com/multiformats/go-multicodec should be used instead.
This commit is contained in:
Marcin Rataj
2022-04-21 22:39:31 +02:00
committed by GitHub
parent ddd9ef7248
commit b2064d74a8
4 changed files with 22 additions and 122 deletions

View File

@@ -59,10 +59,17 @@ fmt.Println("Got CID: ", c)
#### Creating a CID from scratch
```go
import (
cid "github.com/ipfs/go-cid"
mc "github.com/multiformats/go-multicodec"
mh "github.com/multiformats/go-multihash"
)
// Create a cid manually by specifying the 'prefix' parameters
pref := cid.Prefix{
Version: 1,
Codec: cid.Raw,
Codec: mc.Raw,
MhType: mh.SHA2_256,
MhLength: -1, // default length
}