grand

package
v0.0.0-...-2bcc11b Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Int

func Int(min, max int) int

Returns an int >= min, <= max

func RandomBool

func RandomBool() bool

func RandomBuffer

func RandomBuffer(buf []byte) (int, error)

func RandomBytes

func RandomBytes(size int) ([]byte, error)

RandomBytes generates random binary buffer.

func RandomFloat

func RandomFloat(min, max, decimalPoint int) float64

func RandomInt

func RandomInt(min, max int) int

Note: min & max are included in random output.

func RandomPassword

func RandomPassword(chars string, minLen, maxLen int) string

func RandomSimplePassword

func RandomSimplePassword(minLen, maxLen int) string

func RandomString

func RandomString(size int) string

Types

type Ranges

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

func NewRanges

func NewRanges() *Ranges

func (*Ranges) Allow

func (r *Ranges) Allow(min, max rune) *Ranges

func (*Ranges) AllowRune

func (r *Ranges) AllowRune(a rune) *Ranges

func (*Ranges) Generate

func (r *Ranges) Generate(length uint64) string

Jump to

Keyboard shortcuts

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