kubernetesk8s.io/kubernetes/pkg/util/rand Index | Files

package rand

import "k8s.io/kubernetes/pkg/util/rand"

Package rand provides utilities related to randomization.

Index

Functions

func Intn

func Intn(max int) int

Intn generates an integer in range 0->max. By design this should panic if input is invalid, <= 0.

func Perm

func Perm(n int) []int

Perm returns, as a slice of n ints, a pseudo-random permutation of the integers [0,n) from the default Source.

func Seed

func Seed(seed int64)

Seed seeds the rng with the provided seed.

func String

func String(length int) string

String generates a random alphanumeric string n characters long. This will panic if n is less than zero.

Source Files

rand.go

Version
v1.2.0-alpha.5
Published
Dec 15, 2015
Platform
js/wasm
Imports
3 packages
Last checked
40 minutes ago

Tools for package owners.