feat: add cid package
This commit is contained in:
parent
13d1adb717
commit
706f7a05b9
|
@ -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)
|
||||
}
|
Loading…
Reference in New Issue