diff --git a/irc/server.go b/irc/server.go index a870db0d..83acc8f9 100644 --- a/irc/server.go +++ b/irc/server.go @@ -9,7 +9,6 @@ import ( "bufio" "crypto/tls" "fmt" - "math/rand" "net" "net/http" _ "net/http/pprof" @@ -371,13 +370,7 @@ func (server *Server) createListener(addr string, tlsConfig *tls.Config, bindMod // generateMessageID returns a network-unique message ID. func (server *Server) generateMessageID() string { - // we don't need the full like 30 chars since the unixnano below handles - // most of our uniqueness requirements, so just truncate at 5 - lastbit := strconv.FormatInt(rand.Int63(), 36) - if 5 < len(lastbit) { - lastbit = lastbit[:4] - } - return fmt.Sprintf("%s%s", strconv.FormatInt(time.Now().UTC().UnixNano(), 36), lastbit) + return utils.GenerateSecretToken() } // diff --git a/oragono.go b/oragono.go index b7a9eae7..03242897 100644 --- a/oragono.go +++ b/oragono.go @@ -8,10 +8,8 @@ package main import ( "fmt" "log" - "math/rand" "strings" "syscall" - "time" "github.com/docopt/docopt-go" "github.com/oragono/oragono/irc" @@ -114,7 +112,6 @@ Options: } } } else if arguments["run"].(bool) { - rand.Seed(time.Now().UTC().UnixNano()) if !arguments["--quiet"].(bool) { logman.Info("startup", fmt.Sprintf("Oragono v%s starting", irc.SemVer)) if commit == "" {