2
0
mirror of synced 2025-02-24 06:38:14 +00:00
torrent/peerid.go
Matt Joiner e13b0eccbf Make peerID a public type
Wanted it applied to Client Status output
2018-01-06 15:50:45 +11:00

15 lines
229 B
Go

package torrent
import (
"encoding/hex"
)
type PeerID [20]byte
func (me PeerID) String() string {
if me[0] == '-' && me[7] == '-' {
return string(me[:8]) + hex.EncodeToString(me[8:])
}
return hex.EncodeToString(me[:])
}