优化 IP最后一段完全随机

This commit is contained in:
xiu2
2020-11-10 19:22:55 +08:00
parent 8c0e8732cc
commit 3de6b38e00
4 changed files with 32 additions and 15 deletions

18
util.go
View File

@@ -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 {