Migration: go1.20

This commit is contained in:
Dreamacro
2023-02-16 21:43:40 +08:00
parent fbf2f26516
commit 8173d6681b
15 changed files with 65 additions and 69 deletions

View File

@ -4,9 +4,10 @@ import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/base64"
"encoding/binary"
"math/rand"
mathRand "math/rand"
"sync"
"time"
@ -38,7 +39,7 @@ func (a *authData) next() *authData {
defer a.mutex.Unlock()
if a.connectionID > 0xff000000 || a.connectionID == 0 {
rand.Read(a.clientID[:])
a.connectionID = rand.Uint32() & 0xffffff
a.connectionID = mathRand.Uint32() & 0xffffff
}
a.connectionID++
copy(r.clientID[:], a.clientID[:])