court/utils/uuid.go
2024-03-28 11:29:32 +01:00

18 lines
304 B
Go

package utils
import (
"math/rand/v2"
)
const (
rune = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890"
rune_length = len(rune)
)
func GenerateUUID() string {
uuid := make([]byte, 6)
for idx := range 6 {
uuid[idx] = rune[rand.IntN(rune_length)]
}
return string(uuid)
}