Documentation ¶
Overview ¶
Package rand provides utilities related to randomization.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Int63nRange ¶
IntnRange generates an int64 integer in range [min,max). By design this should panic if input is invalid, <= 0.
func Intn ¶
Intn generates an integer in range [0,max). By design this should panic if input is invalid, <= 0.
func IntnRange ¶
IntnRange generates an integer in range [min,max). By design this should panic if input is invalid, <= 0.
func Perm ¶
Perm returns, as a slice of n ints, a pseudo-random permutation of the integers [0,n) from the default Source.
func SafeEncodeString ¶ added in v1.8.0
SafeEncodeString encodes s using the same characters as rand.String. This reduces the chances of bad words and ensures that strings generated from hash functions appear consistent throughout the API.
Types ¶
This section is empty.