helpers

package
v2.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	RandomNumber = iota + 1                                                // RandomNumber define the number random
	RandomLower  = RandomNumber << iota                                    // RandomLower define the lowercase random
	RandomUpper  = RandomNumber << iota                                    // RandomUpper define the uppercase random
	RandomSymbol = RandomNumber << iota                                    // RandomSymbol define the symbol random
	RandomAll    = RandomNumber | RandomLower | RandomUpper | RandomSymbol // RandomAll define the all random
)

Variables

This section is empty.

Functions

func InitRand

func InitRand(rnd int)

InitRand initializes the global random generator

func RandBytes

func RandBytes(size int) []byte

RandBytes generates a random byte slice of given size

func RandString

func RandString(size int) string

RandString generates a random string of given size

Types

type Rand

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

func NewRand

func NewRand(rnd int) *Rand

func (Rand) Rand

func (r Rand) Rand(size int) string

Rand returns a random string

func (Rand) RandBytes

func (r Rand) RandBytes(size int) []byte

RandBytes returns a random byte slice

Jump to

Keyboard shortcuts

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