pplx2api / utils /random.go
github-actions[bot]
Update from GitHub Actions
216f5cb
raw
history blame contribute delete
300 Bytes
package utils
import "math/rand"
func RandomString(length int) string {
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
result := make([]byte, length)
for i := range result {
result[i] = charset[rand.Intn(len(charset))]
}
return string(result)
}