saferand

package
v0.30.6 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rand

type Rand struct {
	// contains filtered or unexported fields
}

Rand is a concurrency-safe source of pseudo-random numbers. The Go stdlib's math/rand.Source is not concurrency-safe. The global source in math/rand would be concurrency safe (due to its internal use of lockedSource), but it is prone to inter-package interference with the PRNG state.

func New

func New(seed int64) *Rand

func (*Rand) Int63n

func (sr *Rand) Int63n(n int64) int64

func (*Rand) Intn

func (sr *Rand) Intn(n int) int

Jump to

Keyboard shortcuts

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