feat: add otp redis repo
This commit is contained in:
@@ -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