mirror of
https://github.com/XIU2/CloudflareSpeedTest.git
synced 2026-04-20 13:16:26 +08:00
优化 IP最后一段完全随机
This commit is contained in:
18
util.go
18
util.go
@@ -89,11 +89,27 @@ var failTime int
|
||||
|
||||
type CloudflareIPDataSet []CloudflareIPData
|
||||
|
||||
func initipEndWith() {
|
||||
func initRandSeed() {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
}
|
||||
|
||||
func randipEndWith() {
|
||||
ipEndWith = uint8(rand.Intn(254) + 1)
|
||||
}
|
||||
|
||||
func ipPadding(ip string) string {
|
||||
var ipLength int
|
||||
var ipPrint string
|
||||
ipPrint = ip
|
||||
ipLength = len(ipPrint)
|
||||
if ipLength < 15 {
|
||||
for i := 0; i <= 15-ipLength; i++ {
|
||||
ipPrint += " "
|
||||
}
|
||||
}
|
||||
return ipPrint
|
||||
}
|
||||
|
||||
func handleProgressGenerator(pb *pb.ProgressBar) func(e progressEvent) {
|
||||
return func(e progressEvent) {
|
||||
switch e {
|
||||
|
||||
Reference in New Issue
Block a user