X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/0ed5132769e88cb385b5240986b706430f0ccd72..f8e4cd540b87de3e308ec18a2b040b284a741522:/hotline/server.go diff --git a/hotline/server.go b/hotline/server.go index 448aab1..5245c7b 100644 --- a/hotline/server.go +++ b/hotline/server.go @@ -4,6 +4,7 @@ import ( "bufio" "bytes" "context" + "crypto/rand" "encoding/binary" "errors" "fmt" @@ -15,7 +16,6 @@ import ( "log" "log/slog" "math/big" - "math/rand" "net" "os" "path" @@ -760,7 +760,8 @@ func (s *Server) NewPrivateChat(cc *ClientConn) []byte { defer s.PrivateChatsMu.Unlock() randID := make([]byte, 4) - rand.Read(randID) + _, _ = rand.Read(randID) + data := binary.BigEndian.Uint32(randID) s.PrivateChats[data] = &PrivateChat{