Files
2018-07-30 13:34:44 +10:00

20 lines
313 B
Go

package common
import (
"math/rand"
)
var Letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
func RandomString(n int) string {
b := make([]rune, n)
for i := range b {
b[i] = Letters[rand.Intn(len(Letters))]
}
return string(b)
}
func NewBool(t bool) *bool {
return &t
}