aboutsummaryrefslogtreecommitdiff
path: root/peer/messages.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-06-16 02:44:50 +0200
committerDimitri Sokolyuk <demon@dim13.org>2016-06-16 02:44:50 +0200
commit36b8cd0ad32bcd967dc98e1ae91943355a5c388e (patch)
tree6d13c0c1654fd079980f314048d75baf910c72d2 /peer/messages.go
parent450a90ebeafd70e44d858a5b428e7d4a526e1b87 (diff)
All random
Diffstat (limited to 'peer/messages.go')
-rw-r--r--peer/messages.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/peer/messages.go b/peer/messages.go
index 4760bb5..1ddaf83 100644
--- a/peer/messages.go
+++ b/peer/messages.go
@@ -22,16 +22,13 @@ const (
_ // keep-alive: <len=0000>
)
-const (
- Proto = `BitTorrent protocol`
- ClientID = `+++ATH0-xxxxxxxxxxxx` // or may be `D13--xxxxxxxxxxxxxxx`
-)
+const Proto = `BitTorrent protocol`
func NewID() (string, error) {
- limit := new(big.Int).Lsh(big.NewInt(1), 48)
+ limit := new(big.Int).Lsh(big.NewInt(1), 80)
id, err := rand.Int(rand.Reader, limit)
if err != nil {
return "", err
}
- return fmt.Sprintf("+++ATH0-%0.12x", id), nil
+ return fmt.Sprintf("%0.20x", id), nil
}