]> Sergey Matveev's repositories - btrtrc.git/blob - peerid.go
Make peerID a public type
[btrtrc.git] / peerid.go
1 package torrent
2
3 import (
4         "encoding/hex"
5 )
6
7 type PeerID [20]byte
8
9 func (me PeerID) String() string {
10         if me[0] == '-' && me[7] == '-' {
11                 return string(me[:8]) + hex.EncodeToString(me[8:])
12         }
13         return hex.EncodeToString(me[:])
14 }