|
@ -2,12 +2,18 @@ package Util |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
"math/rand" |
|
|
"math/rand" |
|
|
|
|
|
"time" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
var ( |
|
|
var ( |
|
|
letterRunes = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") |
|
|
letterRunes = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
func init() { |
|
|
|
|
|
rand.Seed(time.Now().UnixNano()) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// RandomString generates a random string
|
|
|
func RandomString(n int) string { |
|
|
func RandomString(n int) string { |
|
|
var ( |
|
|
var ( |
|
|
b []rune |
|
|
b []rune |
|
|