Documentation
¶
Overview ¶
Package extrand extend rand
Index ¶
- Constants
- Variables
- func Float64(min, max float64) float64
- func Int(min, max int) int
- func Int31(min, max int32) int32
- func Int63(min, max int64) int64
- func Rand(length int, alphabets ...byte) string
- func RandBytes(length int, alphabets ...byte) []byte
- func RandInt64(length int) int64
- func RandLetter(length int) string
- func RandLetterBytes(length int) []byte
- func RandNumeric(length int) string
- func RandNumericBytes(length int) []byte
- func RandString(length int) string
- func RandStringBytes(length int) []byte
- func RandSymbol(length int) string
- func RandSymbolBytes(length int) []byte
- func Shuffle(str string) string
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 RandLetterBytes ¶ added in v0.2.2
RandLetterBytes rand alpha with give length(只包含字母)
func RandNumeric ¶ added in v0.2.2
RandNumeric rand string with give length(包含数字)
func RandNumericBytes ¶ added in v0.2.2
RandNumericBytes rand string with give length(包含数字)
func RandString ¶
RandString rand string with give length(包含字母与数字)
func RandStringBytes ¶ added in v0.2.2
RandStringBytes rand string with give length(包含字母与数字)
func RandSymbol ¶
RandSymbol rand symbol with give length(包含字母数字和特殊符号)
func RandSymbolBytes ¶ added in v0.2.2
RandSymbolBytes rand symbol with give length(包含字母数字和特殊符号)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.