Documentation ¶
Overview ¶
Package random contains a collection of utility functions to generate random numbers and strings.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Rnd ¶
type Rnd struct {
// contains filtered or unexported fields
}
Rnd defines then random number generator.
func New ¶
New initialize the random reader. The r argument must be a cryptographically secure random number generator. The crypto/rand.Read is used as default if r == nil.
func (*Rnd) RandUint32 ¶
RandUint32 returns a pseudo-random 32-bit value as a uint32 from the default Source. It try to use crypto/rand.Reader, if it fails, it falls back to math/rand/v2.Uint32.
func (*Rnd) RandUint64 ¶
RandUint64 returns a pseudo-random 64-bit value as a uint64 from the default Source. It try to use crypto/rand.Reader, if it fails, it falls back to math/rand/v2.Uint64.