后端重构

This commit is contained in:
Yvan
2026-01-08 19:28:58 +08:00
parent 8800c069d9
commit 9cb6b965e0
49 changed files with 4907 additions and 14 deletions
+19
View File
@@ -0,0 +1,19 @@
package utils
import (
"math/rand"
"time"
)
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
var seededRand = rand.New(rand.NewSource(time.Now().UnixNano()))
// RandomString 生成指定长度的随机字符串
func RandomString(length int) string {
b := make([]byte, length)
for i := range b {
b[i] = charset[seededRand.Intn(len(charset))]
}
return string(b)
}