court/utils/uuid.go

19 lines
304 B
Go
Raw Normal View History

2024-03-28 11:29:32 +01:00
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)
}