| package utils | |
| import "math/rand" | |
| func RandomString(length int) string { | |
| const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" | |
| result := make([]byte, length) | |
| for i := range result { | |
| result[i] = charset[rand.Intn(len(charset))] | |
| } | |
| return string(result) | |
| } | |