chore: replace zhangyunhao116/fastrand to our metacubex/randv2

This commit is contained in:
wwqgtxx
2024-05-31 11:31:17 +08:00
parent d3fea909e9
commit 39eda257a7
35 changed files with 136 additions and 111 deletions

View File

@@ -17,7 +17,7 @@ import (
"github.com/metacubex/mihomo/component/proxydialer"
C "github.com/metacubex/mihomo/constant"
"github.com/zhangyunhao116/fastrand"
"github.com/metacubex/randv2"
"golang.org/x/crypto/ssh"
)
@@ -180,10 +180,10 @@ func NewSsh(option SshOption) (*Ssh, error) {
}
version := "SSH-2.0-OpenSSH_"
if fastrand.Intn(2) == 0 {
version += "7." + strconv.Itoa(fastrand.Intn(10))
if randv2.IntN(2) == 0 {
version += "7." + strconv.Itoa(randv2.IntN(10))
} else {
version += "8." + strconv.Itoa(fastrand.Intn(9))
version += "8." + strconv.Itoa(randv2.IntN(9))
}
config.ClientVersion = version