randutil

package
v3.8.2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

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.

Jump to

Keyboard shortcuts

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