16 lines
243 B
Go
16 lines
243 B
Go
|
package misc
|
||
|
|
||
|
import (
|
||
|
"math/rand"
|
||
|
)
|
||
|
|
||
|
func RandomString(n int) string {
|
||
|
var letters = []rune("abcdefghijklmnopqrstuvwxyz0123456789")
|
||
|
|
||
|
s := make([]rune, n)
|
||
|
for i := range s {
|
||
|
s[i] = letters[rand.Intn(len(letters))]
|
||
|
}
|
||
|
return string(s)
|
||
|
}
|