mirror of
https://github.com/pushbits/server.git
synced 2025-04-30 10:46:55 +02:00
14 lines
241 B
Go
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]
|
|
}
|