diff --git a/cid/cid.go b/cid/cid.go new file mode 100644 index 0000000..2fb1666 --- /dev/null +++ b/cid/cid.go @@ -0,0 +1,11 @@ +package cid + +import ( + "github.com/multiformats/go-multibase" +) + +func EncodeHashSimple(hash [32]byte) (string, error) { + prefixedHash := append([]byte{0x26, 0x1f}, hash[:]...) + + return multibase.Encode(multibase.Base58BTC, prefixedHash) +}