mirror of
https://github.com/libp2p/go-libp2p-core.git
synced 2025-01-13 02:10:06 +08:00
remove peer.IDFromString (#274)
This commit is contained in:
parent
2dc986f623
commit
247031f933
@ -114,15 +114,6 @@ func (id ID) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// IDFromString casts a string to the ID type, and validates
|
||||
// the value to make sure it is a multihash.
|
||||
func IDFromString(s string) (ID, error) {
|
||||
if _, err := mh.Cast([]byte(s)); err != nil {
|
||||
return ID(""), err
|
||||
}
|
||||
return ID(s), nil
|
||||
}
|
||||
|
||||
// IDFromBytes casts a byte slice to the ID type, and validates
|
||||
// the value to make sure it is a multihash.
|
||||
func IDFromBytes(b []byte) (ID, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user