owl-blogs/app/utils.go

16 lines
272 B
Go
Raw Normal View History

2023-07-16 19:48:39 +00:00
package app
import (
"math/rand"
)
var letterRunes = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
func RandStringRunes(n int) string {
b := make([]rune, n)
for i := range b {
b[i] = letterRunes[rand.Intn(len(letterRunes))]
}
return string(b)
}