15 lines
317 B
Go
15 lines
317 B
Go
package util
|
|
|
|
import (
|
|
"math/rand"
|
|
)
|
|
|
|
// RandomString creates random string of N integers
|
|
func RandomString(n int) string {
|
|
letters := []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
|
|
s := make([]rune, n)
|
|
for i := range s {
|
|
s[i] = letters[rand.Intn(len(letters))]
|
|
}
|
|
return string(s)
|
|
}
|