feat: add otp redis repo
This commit is contained in:
1 parent
75e1b5111e
commit
36cda3fd5a
6 files changed
+109
-1
No files matched your search
@@ -0,0 +1,14 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"strconv"
|
||||
"time"
|
||||
)
|
||||
|
||||
func GenOTPCode() string {
|
||||
newRand := rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||
minNum := 100000
|
||||
maxNum := 999999
|
||||
return strconv.Itoa(newRand.Intn(maxNum-minNum+1) + minNum)
|
||||
}
|
||||
Reference in new issue
Block a user