Documentation
¶
Overview ¶
Package extrand extend rand
Index ¶
- Variables
- func Float32() float32
- func Float64() float64
- func Float64x(min, max float64) float64
- func Int() int
- func Int31() int32
- func Int31n(n int32) int32
- func Int31x(min, max int32) int32
- func Int63() int64
- func Int63n(n int64) int64
- func Int63x(min, max int64) int64
- func Intn(n int) int
- func Intx(min, max int) int
- func Perm(n int) []int
- func Rand(length int, alphabets ...byte) string
- func RandBytes(length int, alphabets ...byte) []byte
- 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 Uint32() uint32
- func Uint64() uint64
Constants ¶
This section is empty.
Variables ¶
var Digital = []byte("0123456789")
var DigitalLetter = []byte("QWERTYUIOPLKJHGFDSAZXCVBNMabcdefghijklmnopqrstuvwxyz0123456789")
var Letter = []byte("QWERTYUIOPLKJHGFDSAZXCVBNMabcdefghijklmnopqrstuvwxyz")
var Symbol = []byte("QWERTYUIOPLKJHGFDSAZXCVBNMabcdefghijklmnopqrstuvwxyz0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_{|}~`")
Functions ¶
func Float32 ¶ added in v0.2.3
func Float32() float32
Float32 returns, as a float32, a pseudo-random number in [0.0,1.0).
func Float64 ¶
func Float64() float64
Float64 returns, as a float64, a pseudo-random number in [0.0,1.0).
func Int31 ¶
func Int31() int32
Int31 returns a non-negative pseudo-random 31-bit integer as an int32.
func Int31n ¶ added in v0.2.3
Int31n returns, as an int32, a non-negative pseudo-random number in [0,n). It panics if n <= 0.
func Int63 ¶
func Int63() int64
Int63 returns a non-negative pseudo-random 63-bit integer as an int64.
func Int63n ¶ added in v0.2.3
Int63n returns, as an int64, a non-negative pseudo-random number in [0,n). It panics if n <= 0.
func Intn ¶ added in v0.2.3
Intn returns, as an int, a non-negative pseudo-random number in [0,n). It panics if n <= 0.
func Perm ¶ added in v0.2.3
Perm returns, as a slice of n ints, a pseudo-random permutation of the integers [0,n).
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.