arimelody-web/controller/controller.go
2025-09-30 22:34:46 +01:00

13 lines
292 B
Go

package controller
import "math/rand"
func GenerateAlnumString(length int) []byte {
const CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
res := []byte{}
for range length {
res = append(res, CHARS[rand.Intn(len(CHARS))])
}
return res
}