Documentation ¶
Overview ¶
Package randstr provides generating random string As a quick start for generator:
const randomStrLength = 6 generator := randstr.NewFastGenerator(randstr.CharSetEnglishAlphabet) generator.GenerateRandomStr(randomStrLength)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CharSetType ¶
type CharSetType string
const ( CharSetEnglishAlphabet CharSetType = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" CharSetEnglishAlphabetLowercase CharSetType = "abcdefghijklmnopqrstuvwxyz" CharSetEnglishAlphabetUppercase CharSetType = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" CharSetBase62 CharSetType = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" CharSetBase64 CharSetType = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/" )
type FastGenerator ¶
type FastGenerator struct {
// contains filtered or unexported fields
}
func NewFastGenerator ¶
func NewFastGenerator(setType CharSetType) *FastGenerator
func (*FastGenerator) GenerateRandomStr ¶
func (g *FastGenerator) GenerateRandomStr(n int) string
type RandomStrGenerator ¶
Click to show internal directories.
Click to hide internal directories.