mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-02-26 16:57:08 +00:00
chore: replace zhangyunhao116/fastrand to our metacubex/randv2
This commit is contained in:
@@ -21,8 +21,8 @@ import (
|
||||
|
||||
"github.com/metacubex/sing-quic/hysteria2"
|
||||
|
||||
"github.com/metacubex/randv2"
|
||||
M "github.com/sagernet/sing/common/metadata"
|
||||
"github.com/zhangyunhao116/fastrand"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -165,7 +165,7 @@ func NewHysteria2(option Hysteria2Option) (*Hysteria2, error) {
|
||||
})
|
||||
if len(serverAddress) > 0 {
|
||||
clientOptions.ServerAddress = func(ctx context.Context) (*net.UDPAddr, error) {
|
||||
return resolveUDPAddrWithPrefer(ctx, "udp", serverAddress[fastrand.Intn(len(serverAddress))], C.NewDNSPrefer(option.IPVersion))
|
||||
return resolveUDPAddrWithPrefer(ctx, "udp", serverAddress[randv2.IntN(len(serverAddress))], C.NewDNSPrefer(option.IPVersion))
|
||||
}
|
||||
|
||||
if option.HopInterval == 0 {
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user