rand

package
v0.0.0-...-c47bd17 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2023 License: Unlicense Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandBytes

func RandBytes(n int) []byte

func RandInt

func RandInt(n int) int

func RandInt64

func RandInt64(n int64) int64

func RandUint64

func RandUint64(n uint64) uint64

Generate a random uint64 by combining two random int64s

func Temper

func Temper(x uint32) uint32

Types

type Face

type Face = uint8
const (
	Head Face = iota
	Tail
)

func CoinFlip

func CoinFlip() Face

type MersenneTwister

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

func MersenneTwisterFromState

func MersenneTwisterFromState(state [n]uint32) *MersenneTwister

func NewMersenneTwister

func NewMersenneTwister(seed uint32) *MersenneTwister

func (*MersenneTwister) Next

func (mt *MersenneTwister) Next() uint32

Jump to

Keyboard shortcuts

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