rand

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLockedSource

func NewLockedSource(seed int64) rand.Source

NewLockedSource returns a new pseudo-random Source seeded with the given value. The returned source is safe for concurrent usage.

Types

type StringRand

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

StringRand is a source of random characters.

func NewStringRand

func NewStringRand(src rand.Source) *StringRand

NewStringRand returns a Rand implementation that generates strings.

func (*StringRand) Read

func (r *StringRand) Read(p []byte) (n int, err error)

Read generates len(p) random bytes (that can be represented as characters) and writes them into p. It always returns len(p) and a nil error.

Jump to

Keyboard shortcuts

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