mirror of
https://github.com/bestnite/sub2clash.git
synced 2025-06-17 20:53:18 +08:00
♻️ Refactor code
🔥 Remove update detection
This commit is contained in:
13
common/random_string.go
Normal file
13
common/random_string.go
Normal file
@ -0,0 +1,13 @@
|
||||
package common
|
||||
|
||||
import "math/rand"
|
||||
|
||||
func RandomString(length int) string {
|
||||
// 生成随机字符串
|
||||
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
||||
var result []byte
|
||||
for i := 0; i < length; i++ {
|
||||
result = append(result, charset[rand.Intn(len(charset))])
|
||||
}
|
||||
return string(result)
|
||||
}
|
Reference in New Issue
Block a user