19 lines
304 B
Go
19 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)
|
||
|
}
|