pseudorandom

package
v0.0.0-...-b349366 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2020 License: MIT Imports: 4 Imported by: 47

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes

func Bytes(n int) []byte

Bytes generates a random byte slice of length n

func FillBytes

func FillBytes(p []byte)

FillBytes fills the byte slice with random bytes. It does not use an intermediate buffer

func Intn

func Intn(n int) int

Intn returns random int with max n

func New

func New(seed int64) random.Interface

New returns a new Random, in most cases you can also just use the global funcs

func String

func String(n int) string

String returns random string of length n

Types

type TTNRandom

type TTNRandom struct {
	random.Interface
	// contains filtered or unexported fields
}

TTNRandom is used as a wrapper around math/rand

func (*TTNRandom) Bytes

func (r *TTNRandom) Bytes(n int) []byte

func (*TTNRandom) FillBytes

func (r *TTNRandom) FillBytes(p []byte)

func (*TTNRandom) Intn

func (r *TTNRandom) Intn(n int) int

func (*TTNRandom) String

func (r *TTNRandom) String(n int) string

Jump to

Keyboard shortcuts

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