Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RandProvider = NewPseudoRandom()
RandProvider is the default random number generator the api will use.
Functions ¶
This section is empty.
Types ¶
type PseudoRandom ¶
type PseudoRandom struct {
// contains filtered or unexported fields
}
PseudoRandom implements the Random interface using the built-in rand package.
func (*PseudoRandom) Intn ¶
func (p *PseudoRandom) Intn(lower, upper int) int
Intn generates a random integer in the [lower, upper) half-open interval. If upper < lower it panics.
type Random ¶
type Random interface { // Intn generates a random integer in the [lower, upper) // half-open interval. Intn(lower, upper int) int }
Random provides functions to generate random numbers
func NewPseudoRandom ¶
func NewPseudoRandom() Random
NewPseudoRandom returns a new Random backed by the PseudoRandom implementation.
Click to show internal directories.
Click to hide internal directories.