Skip to content

Commit

Permalink
add encode
Browse files Browse the repository at this point in the history
  • Loading branch information
acud committed Feb 20, 2019
1 parent c77795f commit 68e4f0f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions contracts/ens/ens.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 68e4f0f

Please sign in to comment.