package util import ( "math/rand" "time" "unicode" ) const alphabet = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" func init() { rand.Seed(time.Now().UnixNano()) } func GenerateRandomString(n int) string { b := make([]byte, n) for i := range b { b[i] = alphabet[rand.Intn(len(alphabet))] } return string(b) } func IsWhitespaceFree(s string) bool { for _, r := range s { if unicode.IsSpace(r) { return false } } return true }