rand

package
v0.0.0-...-09efcc3 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// SecureRand is a thread-safe math/rand.Source64 backed by crypto/rand.Reader.
	SecureRand = mrand.New(cryptoRandSource{})
	// InsecureRand is a thread-safe math/rand.Source64 seeded by the program start time.
	InsecureRand = mrand.New(&lockedMathRandSource{source: mrand.NewSource(time.Now().UnixNano()).(mrand.Source64)})
)

Functions

func StringWithAlphabet

func StringWithAlphabet(length int, alphabet string, r *mrand.Rand) string

StringWithAlphabet generates a random string of the specific length with the given alphabet using the given RNG.

Types

This section is empty.

Jump to

Keyboard shortcuts

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