Skip to content

Commit

Permalink
Deprecating math.seed usage
Browse files Browse the repository at this point in the history
  • Loading branch information
r65535 committed Mar 29, 2023
1 parent cf53864 commit 5245dd3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/util/cert/certutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ func DecodeCertificate(raw []byte) (cert *x509.Certificate, err error) {

// GeneratePass generates a random password
func GeneratePass(length int) (passw []byte) {
mathrand.Seed(time.Now().UnixNano())
r := mathrand.New(mathrand.NewSource(time.Now().UnixNano()))
var b strings.Builder
for i := 0; i < length; i++ {
b.WriteRune(passChars[mathrand.Intn(len(passChars))])
b.WriteRune(passChars[r.Intn(len(passChars))])
}
passw = []byte(b.String())
return
Expand Down

0 comments on commit 5245dd3

Please sign in to comment.