修复 IP 解析不够随机的问题

This commit is contained in:
xiu2
2021-11-17 15:40:53 +08:00
parent 9471094d27
commit ea46fc5e04
3 changed files with 8 additions and 4 deletions

View File

@@ -22,8 +22,11 @@ var (
IPFile = defaultInputFile
)
func randIPEndWith(num byte) byte {
func InitRandSeed() {
rand.Seed(time.Now().UnixNano())
}
func randIPEndWith(num byte) byte {
return byte(rand.Intn(int(num)))
}