This commit is contained in:
richboo111
2023-04-27 14:45:13 +08:00
parent 5f4de6923b
commit 7cb41a21e7
2 changed files with 17 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ import (
"fmt"
"io"
"log"
r "math/rand"
"net"
"net/http/httptest"
"sync"
@@ -284,3 +285,13 @@ func GenFullUrl() (fullUrl string) {
//fmt.Printf("Create websocket connect failCount:%d", retVal.UserCount)
return fullUrl
}
//生成随机字符串
func RandString() string {
bytes := make([]byte, 16)
for i := 0; i < 16; i++ {
b := r.Intn(26) + 65
bytes[i] = byte(b)
}
return string(bytes)
}