chore: use fastrand to replace math/rand

This commit is contained in:
wwqgtxx
2023-03-06 18:10:14 +08:00
parent ad6336231c
commit 6a97ab9ecb
26 changed files with 109 additions and 111 deletions

View File

@ -5,11 +5,12 @@ import (
"encoding/binary"
"hash/adler32"
"hash/crc32"
"math/rand"
"net"
"github.com/Dreamacro/clash/common/pool"
"github.com/Dreamacro/clash/transport/ssr/tools"
"github.com/zhangyunhao116/fastrand"
)
func init() {
@ -176,7 +177,7 @@ func (a *authSHA1V4) getRandDataLength(size int) int {
return 0
}
if size > 400 {
return rand.Intn(256)
return fastrand.Intn(256)
}
return rand.Intn(512)
return fastrand.Intn(512)
}