Documentation
¶
Overview ¶
Package rand provides the random string
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Digit = NewRand(KindDigit) LowerCase = NewRand(KindLowerCase) UpperCase = NewRand(KindUpperCase) Symbol = NewRand(KindSymbol) LowerAndUpperCase = NewRand(KindLowerCase | KindUpperCase) DigitAndLowerCase = NewRand(KindDigit | KindLowerCase) DigitAndUpperCase = NewRand(KindDigit | KindUpperCase) All = NewRand(KindAll) )
predefined charsets for different random types
Functions ¶
This section is empty.
Types ¶
type Kind ¶
type Kind int
const ( KindDigit Kind = 1 << iota KindLowerCase Kind = 1 << iota KindUpperCase Kind = 1 << iota KindSymbol Kind = 1 << iota KindAll Kind = KindDigit | KindLowerCase | KindUpperCase | KindSymbol KindCustom Kind = 0xFF )
Define a series of character type constants representing different categories of characters. KindDigit - Represents digit characters. KindLowerCase - Represents lowercase letter characters. KindUpperCase - Represents uppercase letter characters. KindSymbol - Represents symbol characters. KindAll - Represents the collective set of all character types, including digits, lowercase, uppercase, and symbols.
type Rand ¶
type Rand struct {
// contains filtered or unexported fields
}
func CustomRand ¶
CustomRand creates a new Rand object with a custom charset.
Parameters: - charset: a string representing the custom charset.
Return: - a pointer to a Rand object.