14 lines
271 B
Go
14 lines
271 B
Go
|
|
package worker
|
||
|
|
|
||
|
|
import "math/rand"
|
||
|
|
|
||
|
|
func GetRandomString(l int) string {
|
||
|
|
str := "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||
|
|
bytes := []byte(str)
|
||
|
|
var result []byte
|
||
|
|
for i := 0; i < l; i++ {
|
||
|
|
result = append(result, bytes[rand.Intn(len(bytes))])
|
||
|
|
}
|
||
|
|
return string(result)
|
||
|
|
}
|