1
0
forked from MTSR/mapserver
mapserver/app/util.go

21 lines
331 B
Go
Raw Permalink Normal View History

2019-01-29 20:00:00 +03:00
package app
import (
"math/rand"
"time"
)
func init() {
rand.Seed(time.Now().UnixNano())
}
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)
}