Documentation ¶
Overview ¶
Package randutil provides pseudo-random number generator utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LockedSource ¶
type LockedSource struct {
// contains filtered or unexported fields
}
LockedSource is a rand.Source, which is safe for concurrent use. Adapted from the non-exported lockedSource from stdlib rand.
func NewLockedSource ¶
func NewLockedSource(src rand.Source) *LockedSource
NewLockedSource returns a rand.Source, which is safe for concurrent use.
func (*LockedSource) Int63 ¶
func (r *LockedSource) Int63() (n int64)
Int63 returns a non-negative pseudo-random 63-bit integer as an int64.
func (*LockedSource) Seed ¶
func (r *LockedSource) Seed(seed int64)
Seed uses the provided seed value to initialize the generator to a deterministic state. Seed should not be called concurrently with any other Rand method.
func (*LockedSource) Uint64 ¶
func (r *LockedSource) Uint64() (n uint64)
Uint64 returns a pseudo-random 64-bit value as a uint64.
Click to show internal directories.
Click to hide internal directories.