mirror of
https://github.com/truewhile/MeBox.git
synced 2026-09-29 11:36:36 +08:00
c55d29ae84
添加strm
15 lines
367 B
Go
15 lines
367 B
Go
package cloud115
|
|
|
|
import "math/rand"
|
|
|
|
const randCharset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
|
|
|
// RandomString 生成指定长度的随机字符串(PKCE code_verifier 等)。
|
|
func RandomString(length int) string {
|
|
b := make([]byte, length)
|
|
for i := range b {
|
|
b[i] = randCharset[rand.Intn(len(randCharset))]
|
|
}
|
|
return string(b)
|
|
}
|