randutil

package
v0.0.0-...-9910822 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2015 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPseudoRand

func NewPseudoRand() (*rand.Rand, int64)

NewPseudoRand returns an instance of math/rand.Rand seeded from crypto/rand and its seed so we can easily and cheaply generate unique streams of numbers. The created object is not safe for concurrent access.

func NewPseudoSeed

func NewPseudoSeed() int64

NewPseudoSeed generates a seed from crypto/rand.

func RandBytes

func RandBytes(r *rand.Rand, size int) []byte

RandBytes returns a byte slice of the given length with random data.

func RandIntInRange

func RandIntInRange(r *rand.Rand, min, max int) int

RandIntInRange returns a value in [min, max)

Types

This section is empty.

Jump to

Keyboard shortcuts

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