rand

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: MIT Imports: 9 Imported by: 2

README

rand

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hex

func Hex(len int) []byte

Hex generate hex bytes

func HexStr

func HexStr(len int) string

HexStr generate hex string

func Int

func Int() int

Int returns, as an int

func IntBetween

func IntBetween(left int, right int) int

IntBetween returns, as an int, a random number in [a,b]

func Intn

func Intn(n int) int

Intn returns, as an int, a non-negative pseudo-random number in [0,n). It panics if n <= 0.

func PIN added in v0.3.0

func PIN(n int) string

func Password added in v0.3.0

func Password(charSize int, digitSize int, symbolSize int) string

func PasswordEasyToRemember added in v0.3.0

func PasswordEasyToRemember(n int) string

func Str added in v0.3.0

func Str(n int) string

func StrWithBase added in v0.3.0

func StrWithBase(base string, n int) string

func TimeBased added in v0.2.20210918085949

func TimeBased() string

TimeBased generate with time based

func TimeBasedFormat added in v0.2.20210918085949

func TimeBasedFormat(f string, opts ...*Option) string

func Username added in v0.3.0

func Username() string

Types

type Option added in v0.2.20210918085949

type Option struct {
	TimeFormat *string
	HexLen     *int
}

func WithHexLen added in v0.2.20210918085949

func WithHexLen(n int) *Option

func WithTimeFormat added in v0.2.20210918085949

func WithTimeFormat(f string) *Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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