added captcha system that generates every 5 minutes

This commit is contained in:
rawleyIfowler
2022-02-26 12:16:53 -06:00
parent 28e52ad4fa
commit 807ca8c5e6
3 changed files with 36 additions and 7 deletions

17
utils/captcha.go Normal file
View 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)
}
}