random

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: MIT Imports: 2 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Digits       = "0123456789"
	LowerLetters = "abcdefghijklmnopqrstuvwxyz"
	UpperLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

	SpecialChars = "!@#$%&*+-=?"

	Space = " "
)

Variables

This section is empty.

Functions

func Chars

func Chars(length int) string

func CustomChars

func CustomChars(lower bool, upper bool, numeric bool, special bool, space bool, num int) string

Password will generate a random password Minimum number length of 5 if less than

func Int

func Int(max int) int

func NInt

func NInt(max, n int, repeat ...bool) []int

当max>=n:从0到max中随机出n个不重复的数;当max<n,随机出可能n个可能重复的数

func Range

func Range(from, to int) int

[from, to)

func Sleep

func Sleep(max int64, least int64)

最大值,最小值,单位ms

Types

This section is empty.

Jump to

Keyboard shortcuts

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