增加vendor

This commit is contained in:
hoteas
2022-05-24 13:49:25 +08:00
parent c3a24eeb3c
commit 65ece0418e
742 changed files with 509206 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
package util
import (
"math/rand"
"time"
)
// RandomStr 随机生成字符串
func RandomStr(length int) string {
str := "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
bytes := []byte(str)
result := []byte{}
r := rand.New(rand.NewSource(time.Now().UnixNano()))
for i := 0; i < length; i++ {
result = append(result, bytes[r.Intn(len(bytes))])
}
return string(result)
}