Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // BaseNumber 用于随机选的数字 BaseNumber = "0123456789" // BaseChar 用于随机选的字符 BaseChar = "abcdefghijklmnopqrstuvwxyz" // BaseCharNumber 用于随机选的字符和数字 BaseCharNumber = fmt.Sprintf("%v%v", BaseChar, BaseNumber) )
Functions ¶
func RandomLong ¶
RandomLong 返回一个介于0和max之间的int数:[0,max)。 注意: 1. max只能大于0,否则直接返回max; 2. 结果大于或等于0,但小于max; 3. 结果数字为32位,小于math. max32。
func RandomNumbers ¶
RandomNumbers 获得一个只包含数字的字符串 @param length – 字符串的长度 @return 随机字符串
func RandomStrBasic ¶
RandomStrBasic 获得一个随机的字符串 @param baseString 随机字符选取的样本 @param length 字符串的长度
func RandomStringWithoutStr ¶
RandomStringWithoutStr 获得一个随机的字符串(只包含数字和字符) 并排除指定字符串 @param length – 字符串的长度 @param elemData – 要排除的字符串,如:去重容易混淆的字符串,oO0、lL1、q9Q、pP @return 随机字符串
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.