X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=peerid.go;h=301c0e946dc8ce53124d56561850ee0763afdafc;hb=HEAD;hp=1514b79c02ccf0b4fdacb867a2839f331a0bc6ed;hpb=d5f8440e7e5b30943d23a9adf0039d6aec1436b0;p=btrtrc.git diff --git a/peerid.go b/peerid.go index 1514b79c..301c0e94 100644 --- a/peerid.go +++ b/peerid.go @@ -1,17 +1,5 @@ package torrent -import ( - "encoding/hex" -) +import "github.com/anacrolix/torrent/types" -// Peer client ID. -type PeerID [20]byte - -// Pretty prints the ID as hex, except parts that adher to the Peer ID -// Conventions of BEP 20. -func (me PeerID) String() string { - if me[0] == '-' && me[7] == '-' { - return string(me[:8]) + hex.EncodeToString(me[8:]) - } - return hex.EncodeToString(me[:]) -} +type PeerID = types.PeerID