extrand

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2021 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Overview

Package extrand extend rand

Index

Constants

View Source
const (
	LetterString = "QWERTYUIOPLKJHGFDSAZXCVBNMabcdefghijklmnopqrstuvwxyz"

	DigitalLetterString = "QWERTYUIOPLKJHGFDSAZXCVBNMabcdefghijklmnopqrstuvwxyz0123456789"

	DigitalString = "0123456789"

	SymbolString = "QWERTYUIOPLKJHGFDSAZXCVBNMabcdefghijklmnopqrstuvwxyz0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_{|}~`"
)

Variables

View Source
var Digital = []byte(DigitalString)
View Source
var DigitalLetter = []byte(DigitalLetterString)
View Source
var Letter = []byte(LetterString)
View Source
var Symbol = []byte(SymbolString)

Functions

func Float64

func Float64(min, max float64) float64

Float64 随机min,max中的值

func Int

func Int(min, max int) int

Int 随机[min,max)中的值

func Int31

func Int31(min, max int32) int32

Int31 随机[min,max)中的值

func Int63

func Int63(min, max int64) int64

Int63 随机[min,max)中的值

func Rand added in v0.2.2

func Rand(length int, alphabets ...byte) string

Rand rand bytes(如果没有给出alphabets,将使用DigitalLetter)

func RandBytes added in v0.2.2

func RandBytes(length int, alphabets ...byte) []byte

RandBytes rand bytes(如果没有给出alphabets,将使用DigitalLetter)

func RandInt64

func RandInt64(length int) int64

RandInt64 rand int64 with give length

func RandLetter

func RandLetter(length int) string

RandLetter rand alpha with give length(只包含字母)

func RandLetterBytes added in v0.2.2

func RandLetterBytes(length int) []byte

RandLetterBytes rand alpha with give length(只包含字母)

func RandNumeric added in v0.2.2

func RandNumeric(length int) string

RandNumeric rand string with give length(包含数字)

func RandNumericBytes added in v0.2.2

func RandNumericBytes(length int) []byte

RandNumericBytes rand string with give length(包含数字)

func RandString

func RandString(length int) string

RandString rand string with give length(包含字母与数字)

func RandStringBytes added in v0.2.2

func RandStringBytes(length int) []byte

RandStringBytes rand string with give length(包含字母与数字)

func RandSymbol

func RandSymbol(length int) string

RandSymbol rand symbol with give length(包含字母数字和特殊符号)

func RandSymbolBytes added in v0.2.2

func RandSymbolBytes(length int) []byte

RandSymbolBytes rand symbol with give length(包含字母数字和特殊符号)

func Shuffle

func Shuffle(str string) string

Shuffle pseudo-randomizes the order of elements using the default Source.

Types

This section is empty.

Jump to

Keyboard shortcuts

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