Documentation
¶
Overview ¶
Package rands 生成各种随机字符串
// 生成一个长度介于 [6,9) 之间的随机字符串 str := rands.String(6, 9, "1343567") // 生成一个带缓存功能的随机字符串生成器 r := rands.New(time.Now().Unix(), 100, 5, 7, "adbcdefgadf;dfe1334") str1 := r.String() str2 := r.String()
NOTE: 仅是随机字符串,不保证唯一性。
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Alpha = []byte(alpha) Number = []byte(number) Punctuation = []byte(punctuation) AlphaNumber = []byte(alphaNumber) AlphaNumberPunctuation = []byte(alphaNumberPunctuation) )
提供几种常见的随机字符组合方式
Functions ¶
Types ¶
type Rands ¶
type Rands struct {
// contains filtered or unexported fields
}
Rands 提供随机字符串的生成
Click to show internal directories.
Click to hide internal directories.