Documentation
¶
Index ¶
Constants ¶
View Source
const ( LcgDefaultMudu int64 = 4294967296 //math.Pow(2.0, 32.0) LcgDefaultMult int64 = 1103515245 LcgDefaultInc int64 = 12345 LcgMaxRand int64 = 4294967295 )
View Source
const ( //CharsCaseAlphanumeric the alphanumeric include upper and lower:`0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` CharsCaseAlphanumeric = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" //CharsUpperAlphanumeric the alphanumeric include upper:`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ` CharsUpperAlphanumeric = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" //CharsLowerAlphanumeric the alphanumeric include lower:`0123456789abcdefghijklmnopqrstuvwxyz` CharsLowerAlphanumeric = "0123456789abcdefghijklmnopqrstuvwxyz" //CharsUpperAlphabet the upper alphabet:`ABCDEFGHIJKLMNOPQRSTUVWXYZ` CharsUpperAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" //CharsLowerAlphabet the lower alphabet:`abcdefghijklmnopqrstuvwxyz` CharsLowerAlphabet = "abcdefghijklmnopqrstuvwxyz" //CharsUpperHex the hex alphabet and numeric:`0123456789abcdef` CharsUpperHex = "0123456789ABCDEF" //CharsLowerHex the hex alphabet and numeric:`0123456789abcdef` CharsLowerHex = "0123456789abcdef" //CharsNumeric the numeric:`0123456789abcdef` CharsNumeric = "0123456789" )
View Source
const ( //AlphanumericCase alphanumericType is CharsCaseAlphanumeric AlphanumericCase = iota //AlphanumericUpper alphanumericType is CharsUpperAlphanumeric AlphanumericUpper //AlphanumericLower alphanumericType is CharsLowerAlphanumeric AlphanumericLower )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LCGRandom ¶ added in v0.0.3
type LCGRandom struct {
// contains filtered or unexported fields
}
linear congruential generator
func NewLGCWith ¶ added in v0.0.3
type Mixer ¶
type Mixer struct {
// contains filtered or unexported fields
}
Mixer a mixer instance for encode/decode
func NewAlphanumeric ¶
NewAlphanumeric must create a new mixer with alphanumeric
func NewNumeric ¶
NewNumeric must create a new mixer with numeric
func (Mixer) DecodeString ¶
DecodeString decode string
func (Mixer) EncodeString ¶
EncodeString encode string
Click to show internal directories.
Click to hide internal directories.