Documentation
¶
Index ¶
Constants ¶
View Source
const ( //LcgDefaultModulus default modulus LcgDefaultModulus int64 = 4294967296 //math.Pow(2.0, 32.0) //LcgDefaultMultiplier default multiplier LcgDefaultMultiplier int64 = 1103515245 //LcgDefaultIncrement default increment LcgDefaultIncrement int64 = 12345 )
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" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlphanumericType ¶ added in v0.0.4
type AlphanumericType int
AlphanumericType alphanumeric type
const ( //AlphanumericCase AlphanumericType is CharsCaseAlphanumeric AlphanumericCase AlphanumericType = iota //AlphanumericUpper AlphanumericType is CharsUpperAlphanumeric AlphanumericUpper //AlphanumericLower AlphanumericType is CharsLowerAlphanumeric AlphanumericLower )
type LCGRandom ¶ added in v0.0.3
type LCGRandom struct {
// contains filtered or unexported fields
}
LCGRandom linear congruential generator
func NewLGCWith ¶ added in v0.0.3
NewLGCWith new LGC with more parameters.
type Mixer ¶
type Mixer struct {
// contains filtered or unexported fields
}
Mixer a mixer instance for encode/decode
func MustNewWithChars ¶ added in v0.0.4
MustNewWithChars must create a new mixer
func NewWithChars ¶ added in v0.0.4
NewWithChars create a new mixer
func Newt ¶ added in v0.0.4
func Newt(salt string, alphanumericType AlphanumericType) *Mixer
Newt create a new mixer with alphanumeric and AlphanumericType
func (Mixer) DecodeString ¶
DecodeString decode string
func (Mixer) EncodeString ¶
EncodeString encode string
Click to show internal directories.
Click to hide internal directories.