]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Add some helpful comments to type PeerID
authorMatt Joiner <anacrolix@gmail.com>
Thu, 25 Jan 2018 02:14:37 +0000 (13:14 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 25 Jan 2018 02:14:37 +0000 (13:14 +1100)
peerid.go

index c9e3f4cdae94ac8f93ba6f4a283c296f40aff84a..1514b79c02ccf0b4fdacb867a2839f331a0bc6ed 100644 (file)
--- a/peerid.go
+++ b/peerid.go
@@ -4,8 +4,11 @@ import (
        "encoding/hex"
 )
 
+// 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:])