portal/cid/cid.go

12 lines
239 B
Go
Raw Normal View History

2023-05-04 08:14:47 +00:00
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)
}