forked from forks/go-ethereum
add encode
This commit is contained in:
parent
c77795f546
commit
68e4f0f564
1 changed files with 7 additions and 0 deletions
|
|
@ -273,3 +273,10 @@ func decodeMultiCodec(b []byte) (common.Hash, error) {
|
|||
//<protoCode uvarint><cid-version><multicodec-content-type><multihash-content-address>
|
||||
|
||||
}
|
||||
|
||||
func encodeMultiCodec(h common.Hash) []byte {
|
||||
b := []byte{0xe4, 0x01, 0x01, 0x1b, 0x20}
|
||||
|
||||
b = append(b, h.Bytes()...)
|
||||
return b
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue