feat: add otp redis repo

This commit is contained in:
2025-09-15 13:03:48 +03:30
parent 75e1b5111e
commit 36cda3fd5a
6 changed files with 109 additions and 1 deletions
+14
View File
@@ -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)
}