2024-08-18 06:09:52 +00:00
|
|
|
package services
|
|
|
|
|
|
|
|
import (
|
|
|
|
"math/rand"
|
|
|
|
)
|
|
|
|
|
2024-08-20 09:08:40 +00:00
|
|
|
var letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
|
2024-08-18 06:09:52 +00:00
|
|
|
|
|
|
|
func RandString(length int) string {
|
2024-08-18 09:16:14 +00:00
|
|
|
builder := make([]rune, length)
|
|
|
|
for i := range builder {
|
|
|
|
builder[i] = letters[rand.Intn(len(letters))]
|
2024-08-18 06:09:52 +00:00
|
|
|
}
|
2024-08-18 09:16:14 +00:00
|
|
|
return string(builder)
|
2024-08-18 06:09:52 +00:00
|
|
|
}
|