12345678910111213141516171819 |
- package utils
- import (
- "math/rand"
- "strings"
- "time"
- )
- func RandString() string {
- rand.Seed(time.Now().UnixNano())
- chars := []rune("abcdefghijklmnopqrstuvwxyz" +
- "0123456789")
- length := 24
- var b strings.Builder
- for i := 0; i < length; i++ {
- b.WriteRune(chars[rand.Intn(len(chars))])
- }
- return b.String()
- }
|