MCPcopy Create free account
hub / github.com/SeeFlowerX/stackplz / RandStringBytes

Function RandStringBytes

user/util/helper.go:19–26  ·  view source on GitHub ↗
(n int)

Source from the content-addressed store, hash-verified

17const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
18
19func RandStringBytes(n int) string {
20 rand.Seed(time.Now().UnixNano())
21 b := make([]byte, n)
22 for i := range b {
23 b[i] = letterBytes[rand.Intn(len(letterBytes))]
24 }
25 return string(b)
26}
27
28func StrToNum(text string) uint32 {
29 value, err := strconv.ParseUint(text, 10, 32)

Callers 1

setupManagerMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected