rand

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2024 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AlphabetLower = []rune("abcdefghijklmnopqrstuvwxyz")
	AlphabetUpper = []rune("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
	Hex           = []rune("0123456789abcdef")
	Numbers       = []rune("0123456789")
)

Functions

This section is empty.

Types

type SeededRand

type SeededRand struct {
	Source rand.Source
	Rand   *rand.Rand
}

func NewSeededRand

func NewSeededRand(seed int64) *SeededRand

func NewSeededRandFromString

func NewSeededRandFromString(stringSeed string) *SeededRand

func NewSeededRandFromTime

func NewSeededRandFromTime() *SeededRand

func (*SeededRand) Choice

func (sr *SeededRand) Choice(slice []interface{}) interface{}

Generic functions

func (*SeededRand) RandomBool

func (sr *SeededRand) RandomBool() bool

Bool functions

func (*SeededRand) RandomFloat

func (sr *SeededRand) RandomFloat(min float64, max float64) float64

Float functions

func (*SeededRand) RandomInt

func (sr *SeededRand) RandomInt(min int, max int) int

Int functions

func (*SeededRand) RandomString

func (sr *SeededRand) RandomString(length int, runes ...[]rune) string

String functions

func (*SeededRand) SetSource added in v1.0.0

func (sr *SeededRand) SetSource(source rand.Source)

Getters and setters

func (*SeededRand) StringChoice

func (sr *SeededRand) StringChoice(stringSlice *[]string) string

Array functions

func (*SeededRand) StringChoiceMultiple

func (sr *SeededRand) StringChoiceMultiple(stringSlice *[]string, numChoices int) []string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL