1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-28 00:39:31 +08:00

added u.Key.String

This commit is contained in:
Juan Batiz-Benet
2014-10-07 05:00:19 -07:00
parent 5ba2efc2b8
commit b98e48836f

View File

@ -39,11 +39,12 @@ var ErrNotFound = ds.ErrNotFound
// Key is a string representation of multihash for use with maps.
type Key string
// String returns Key in a b58 encoded string
// String is utililty function for printing out keys as strings (Pretty).
func (k Key) String() string {
return b58.Encode([]byte(k))
return key.Pretty()
}
// Pretty returns Key in a b58 encoded string
func (k Key) Pretty() string {
return b58.Encode([]byte(k))
}