random

package
v0.0.0-...-828df2f Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRandReadBytesUnexpected = errors.New("read an unexpected number of random bytes")

Functions

This section is empty.

Types

type Random

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

Random implements Randomer.

func NewRandom

func NewRandom() *Random

NewRandom returns a new Random object.

func (*Random) GenerateRandomAlphaNum

func (r *Random) GenerateRandomAlphaNum(length uint64) string

GenerateRandomAlphaNum returns a string of random alphanumeric characters of a specified length.

func (*Random) GenerateRandomBytes

func (r *Random) GenerateRandomBytes(n int) ([]byte, error)

GenerateRandomBytes generates n random bytes.

func (*Random) GenerateRandomInt

func (r *Random) GenerateRandomInt(n int) (result int)

GenerateRandomInt returns a random integer between 0 and n.

func (*Random) GenerateRandomInt63

func (r *Random) GenerateRandomInt63() int64

GenerateRandomInt63 returns a random 63 bit positive integer.

func (*Random) GenerateRandomNum

func (r *Random) GenerateRandomNum(n uint64) string

GenerateRandomNum returns a string of random numeric characters of a specified length.

Directories

Path Synopsis
sources

Jump to

Keyboard shortcuts

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