tendermint/common/random.go

13 lines
175 B
Go
Raw Normal View History

package common
import "crypto/rand"
func RandStr(length int) string {
b := make([]byte, length)
_, err := rand.Read(b)
if err != nil {
return ""
}
return string(b)
}