Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
foolin committed May 1, 2020
1 parent 6b21faa commit 2b82e12
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion mixer.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ const (
)

const (
//AlphanumericCase alphanumericType is CharsCaseAlphanumeric
AlphanumericCase = iota
//AlphanumericCase alphanumericType is CharsUpperAlphanumeric
AlphanumericUpper
//AlphanumericCase alphanumericType is CharsLowerAlphanumeric
AlphanumericLower
)

Expand Down Expand Up @@ -79,7 +82,7 @@ func MustNew(salt string, chars string, moreChars ...string) *Mixer {
func NewAlphanumeric(salt string, alphanumericType int) *Mixer {
switch alphanumericType {
case AlphanumericUpper:
return MustNew(salt, CharsUpperAlphabet)
return MustNew(salt, CharsUpperAlphanumeric)
case AlphanumericLower:
return MustNew(salt, CharsLowerAlphanumeric)
case AlphanumericCase:
Expand Down
2 changes: 1 addition & 1 deletion mixer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestMixerTimes(t *testing.T) {

func runTest(t *testing.T, isLog bool) {
salt := "123456"
alphanumericAndUpperMixer, _ := New(salt, CharsLowerAlphanumeric, CharsLowerAlphabet)
alphanumericAndUpperMixer, _ := New(salt, CharsNumeric, CharsLowerAlphabet, CharsUpperAlphabet)
myCharsChars, _ := New(salt, "0123456789ABCabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_@!", "0123456789ABCEF&^%")
sources := []string{
"HelloMixer",
Expand Down

0 comments on commit 2b82e12

Please sign in to comment.