package
0.1.0
Repository: https://github.com/puppetlabs/leg.git
Documentation: pkg.go.dev

# Packages

Package gonumext provides constructors for random factories using some of the algorithms provided by the Gonum PRNG library.

# Functions

Float64 returns, as a float64, a pseudo-random number in [0.0,1.0).
Float64Between returns, as a float64, a pseudo-random number between [lo,hi).
NewConstantSeeder creates a new seeder with the given fixed seed.
NewExpRandFactory creates a factory for producing RNGs from a source compatible with Go's new experimental rand package initialized with the given seeder.
NewPCGFactory creates a factory for producing RNGs using the permuted congruential generator (PCG) algorithm.
NewTestFactory creates a Goroutine-safe factory for constructing test RNGs that start from a seed provided by the specified seeder.
ThreadSafe makes the given RNG safe to use across Goroutines.
Uint64 returns a pseudo-random 64-bit integer as a uint64.
Uint64Between returns, as a uint64, a pseudo-random number in [lo,hi).
Uint64N returns, as a uint64, a pseudo-random number in [0,n).

# Variables

DefaultFactory is a PCG RNG that is initially seeded by the SecureSeeder.
ErrImpossible is returned by discrete functions if an invocation would result in a random number generator faulting because the parameters requested cannot be computed.
OneSeeder seeds RNGs with 1 for testing purposes.
SecureFactory provides SecureRand as a factory for compatibility with users that expect a factory.
SecureRand is the system cryptographically-secure random number generator.
SecureSeeder seeds non-secure RNGs with a value produced by SecureRand.
ZeroSeeder seeds RNGs with 0 for testing purposes.

# Structs

ConstantSeeder seeds RNGs with a fixed value for testing purposes.
ExpRandFactory is a Goroutine-safe factory for random number generators that use a source compatible with Go's new experimental rand (golang.org/x/exp/rand) package.
TestFactory provides an RNG for testing purposes that simply increments the seed value provided to it.

# Interfaces

DiscreteRand is a random number generator that natively supports generating integers in addition to producing random byte data.
Factory is a Goroutine-safe factory for constructing and seeding random number generators using a particular algorithm.
LockableRand is a specialization of Rand that allows implementations to choose their own behavior to become Goroutine-safe.
Rand defines an instance of a random number generator.
Seedable is the type of an RNG that is able to be seeded.
Seeder seeds an RNG with a particular value or algorithm.

# Type aliases

FactoryFunc allows a factory to be defined by a function.
Seed is a Seedable that simply stores the seed value to be retrieved later.