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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user