From 36b8cd0ad32bcd967dc98e1ae91943355a5c388e Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Thu, 16 Jun 2016 02:44:50 +0200 Subject: All random --- peer/messages.go | 9 +++------ 1 file 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: ) -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 } -- cgit v1.2.3