all: stop using math/rand.Seed

Fixes #16428.

Signed-off-by: Jes Cok <xigua67damn@gmail.com>
This commit is contained in:
Jes Cok
2023-08-20 16:25:25 +08:00
parent cfbb60d8af
commit 52748f60f3
7 changed files with 0 additions and 14 deletions

View File

@@ -16,7 +16,6 @@ package stringutil
import (
"math/rand"
"time"
)
// UniqueStrings returns a slice of randomly generated unique strings.
@@ -45,7 +44,6 @@ func RandomStrings(slen uint, n int) (ss []string) {
const chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
func RandString(l uint) string {
rand.Seed(time.Now().UnixNano())
s := make([]byte, l)
for i := 0; i < int(l); i++ {
s[i] = chars[rand.Intn(len(chars))]