MCPcopy Create free account
hub / github.com/Yihsiwei/GoFileBinder / RandStr

Function RandStr

GoFileBinder.go:34–43  ·  view source on GitHub ↗
(length int)

Source from the content-addressed store, hash-verified

32)
33
34func RandStr(length int) string {
35 str := "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
36 bytes := []byte(str)
37 result := []byte{}
38 rand.Seed(time.Now().UnixNano() + int64(rand.Intn(100)))
39 for i := 0; i < length; i++ {
40 result = append(result, bytes[rand.Intn(len(bytes))])
41 }
42 return string(result)
43}
44func main() {
45
46 fmt.Println(logo)

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected