MCPcopy
hub / github.com/silenceper/wechat / RandomStr

Function RandomStr

util/string.go:9–18  ·  view source on GitHub ↗

RandomStr 随机生成字符串

(length int)

Source from the content-addressed store, hash-verified

7
8// RandomStr 随机生成字符串
9func RandomStr(length int) string {
10 str := "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
11 bytes := []byte(str)
12 result := []byte{}
13 r := rand.New(rand.NewSource(time.Now().UnixNano()))
14 for i := 0; i < length; i++ {
15 result = append(result, bytes[r.Intn(len(bytes))])
16 }
17 return string(result)
18}

Callers 12

GetConfigMethod · 0.92
GetAgentConfigMethod · 0.92
GetQrContentTargetURLMethod · 0.92
GetSignParamMethod · 0.92
SendRedpacketMethod · 0.92
WalletTransferMethod · 0.92
QueryOrderMethod · 0.92
CloseOrderMethod · 0.92
BridgeAppConfigMethod · 0.92
PrePayOrderMethod · 0.92
GetConfigContextMethod · 0.92
GetConfigContextMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…