README 文件修改

This commit is contained in:
Connor
2026-01-12 17:44:12 +08:00
parent 0b60c43872
commit 2fa83d53a4
3 changed files with 37 additions and 43 deletions

View File

@@ -1,28 +0,0 @@
package utils
import (
"math/rand"
"time"
)
func init() {
rand.Seed(time.Now().UnixNano())
}
func GenerateVerificationCode(length int) string {
digits := "0123456789"
code := make([]byte, length)
for i := range code {
code[i] = digits[rand.Intn(len(digits))]
}
return string(code)
}
func GenerateRandomString(length int) string {
chars := "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
result := make([]byte, length)
for i := range result {
result[i] = chars[rand.Intn(len(chars))]
}
return string(result)
}