Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // LetterString 生成给定长度的随机字符串,只包含字母(a-zA-Z). /* e.g. fmt.Println(randomKit.LetterString(20)) // lheIFnhIxSiBteKONNii */ LetterString func(length int) string = random.RandString // NumberString 生成给定长度的随机数字字符串(0-9). NumberString func(length int) string = random.RandNumeral // LowerString 生成给定长度的随机小写字母字符串(a-z). LowerString func(length int) string = random.RandLower // UpperString 生成给定长度的随机大写字母字符串(A-Z). UpperString func(length int) string = random.RandUpper // NumberOrLetterString 生成给定长度的随机字符串(数字 + 字母; A-Z + a-z + 0-9). NumberOrLetterString func(length int) string = random.RandNumeralOrLetter )
View Source
var Bytes func(n int) []byte = grand.B
Bytes 返回指定长度的二进制[]byte数据
e.g.
data := randomKit.Bytes(20) fmt.Println(data) // [193 72 130 210 86 72 180 144 91 246 162 215 176 4 169 153 130 140 89 15]
View Source
var ( // Duration /* @return a random time.Duration between min and max: [min, max] */ Duration func(min, max time.Duration) time.Duration = grand.D )
View Source
var ( // Int 生成随机int /* PS: (1) 如果min == max,将返回 min; (2) 如果min > max,将交换两者的值. @param min 可以 < 0 @param max 可以 < 0 @return 范围: [min, max) */ Int func(min, max int) int = random.RandInt )
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.