From 2b82e12825eb8ce6a7275d2dc2a8899387d46243 Mon Sep 17 00:00:00 2001 From: foolin Date: Sat, 2 May 2020 01:03:15 +0800 Subject: [PATCH] fix bug --- mixer.go | 5 ++++- mixer_test.go | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mixer.go b/mixer.go index 7f82ccf..596cba5 100644 --- a/mixer.go +++ b/mixer.go @@ -30,8 +30,11 @@ const ( ) const ( + //AlphanumericCase alphanumericType is CharsCaseAlphanumeric AlphanumericCase = iota + //AlphanumericCase alphanumericType is CharsUpperAlphanumeric AlphanumericUpper + //AlphanumericCase alphanumericType is CharsLowerAlphanumeric AlphanumericLower ) @@ -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: diff --git a/mixer_test.go b/mixer_test.go index 5366244..b7ffcfd 100644 --- a/mixer_test.go +++ b/mixer_test.go @@ -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",