// IDFromPublicKey returns the Peer ID corresponding to pk func IDFromPublicKey(pk ic.PubKey) (ID, error) { b, err := pk.Bytes() if err != nil { return "", err } hash := u.Hash(b) return ID(hash), nil }