random

package
v0.0.0-...-a30bc99 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IntFromThresholdMap

func IntFromThresholdMap(items map[int]int) (int, error)

IntFromThresholdMap returns a random weighted int

func SeedFromString

func SeedFromString(source string) error

SeedFromString uses a string to seed the random number generator

func SeedString

func SeedString() string

SeedString returns a random string that can be used to seed a generator

func String

func String(items []string) (string, error)

String returns a random string from a slice of strings

func StringFromThresholdMap

func StringFromThresholdMap(items map[string]int) (string, error)

StringFromThresholdMap returns a random weighted string

func StringSubset

func StringSubset(items []string, maxItems int) ([]string, error)

StringSubset returns a random slice of strings from a slice of strings

Types

This section is empty.

Jump to

Keyboard shortcuts

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