Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RandStringHex ¶
Generate a random string for hexadecimal. Docker Id use this.
func RandStringNumber ¶
RandStringNumber 创建指定位数的数字字符串; n < 18 , 常用于短信验证码等情况
Types ¶
type WeightRand ¶
type WeightRand struct {
// contains filtered or unexported fields
}
WeightRand 加权随机
func NewWeightRand ¶
func NewWeightRand(data []Choice) WeightRand
NewWeightRand 创建一个加权随机算法。 该算法使用将权重放入一个有序数组,然后从随机数,二分法去查找有效区间,得出结果
Click to show internal directories.
Click to hide internal directories.