Commit 7a793847 authored by Jeromy's avatar Jeromy

no longer use 'key' type

parent b4fe1c0f
......@@ -33,11 +33,6 @@
"hash": "QmYpVUnnedgGrp6cX2pBii5HRQgcSr778FiKVe7o7nF5Z3",
"name": "go-testutil",
"version": "1.0.2"
},
{
"hash": "Qmce4Y4zg3sYr7xKM5UueS67vhNni6EeWgCRnb7MbLJMew",
"name": "go-key",
"version": "1.0.2"
}
],
"gxVersion": "0.4.0",
......
......@@ -6,7 +6,6 @@ import (
"errors"
u "github.com/ipfs/go-ipfs-util"
key "github.com/ipfs/go-key"
peer "github.com/ipfs/go-libp2p-peer"
ks "github.com/libp2p/go-libp2p-kbucket/keyspace"
)
......@@ -46,13 +45,13 @@ func ConvertPeerID(id peer.ID) ID {
}
// ConvertKey creates a DHT ID by hashing a local key (String)
func ConvertKey(id key.Key) ID {
func ConvertKey(id string) ID {
hash := sha256.Sum256([]byte(id))
return hash[:]
}
// Closer returns true if a is closer to key than b is
func Closer(a, b peer.ID, key key.Key) bool {
func Closer(a, b peer.ID, key string) bool {
aid := ConvertPeerID(a)
bid := ConvertPeerID(b)
tgt := ConvertKey(key)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment