add encode

This commit is contained in:
Elad Nachmias
2019-02-20 22:28:28 +07:00
parent c77795f546
commit 68e4f0f564

View File

@ -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
}