added captcha system that generates every 5 minutes
This commit is contained in:
17
utils/captcha.go
Normal file
17
utils/captcha.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"time"
|
||||
)
|
||||
|
||||
func GenerateCaptchaValues() (int, int) {
|
||||
return rand.Intn(100), rand.Intn(100)
|
||||
}
|
||||
|
||||
func UpdateCaptcha(captcha *[2]int) {
|
||||
for {
|
||||
captcha[0], captcha[1] = GenerateCaptchaValues()
|
||||
time.Sleep(5 * time.Minute)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user