init repo

This commit is contained in:
VaalaCat
2024-08-28 00:02:28 +08:00
committed by vaalacat
commit 13148b95e3
97 changed files with 10214 additions and 0 deletions

21
utils/idgen.go Normal file
View File

@@ -0,0 +1,21 @@
package utils
import (
"strings"
"github.com/google/uuid"
)
func GenerateUID() string {
return uuid.New().String()
}
func L32UID() string {
o := GenerateUID()
n := strings.Replace(o, "-", "", -1)
return n
}
func GenCode() string {
return strings.ToUpper(L32UID()[0:6])
}