mirror of
https://github.com/github/codeql.git
synced 2025-12-22 03:36:30 +01:00
19 lines
294 B
Go
19 lines
294 B
Go
package main
|
|
|
|
import (
|
|
"crypto/rand"
|
|
"math/big"
|
|
)
|
|
|
|
func generatePasswordGood() string {
|
|
s := make([]rune, 20)
|
|
for i := range s {
|
|
idx, err := rand.Int(rand.Reader, big.NewInt(int64(len(charset))))
|
|
if err != nil {
|
|
// handle err
|
|
}
|
|
s[i] = charset[idx.Int64()]
|
|
}
|
|
return string(s)
|
|
}
|