2025-01-20 15:08:01 +00:00
|
|
|
package controller
|
|
|
|
|
|
|
|
import "math/rand"
|
|
|
|
|
|
|
|
func GenerateAlnumString(length int) []byte {
|
|
|
|
const CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
|
|
|
res := []byte{}
|
2025-09-30 22:34:46 +01:00
|
|
|
for range length {
|
2025-01-20 15:08:01 +00:00
|
|
|
res = append(res, CHARS[rand.Intn(len(CHARS))])
|
|
|
|
}
|
|
|
|
return res
|
|
|
|
}
|
|
|
|
|