pushbits/tests/mockups/helper.go
2021-07-22 19:22:51 +02:00

14 lines
241 B
Go

package mockups
import (
"crypto/rand"
"encoding/base64"
)
func randStr(len int) string {
buff := make([]byte, len)
rand.Read(buff)
str := base64.StdEncoding.EncodeToString(buff)
// Base 64 can be longer than len
return str[:len]
}