0
0
mirror of https://github.com/rls-moe/nyx synced 2024-11-13 22:12:24 +00:00
nyx/resources/captcha.go
2017-03-13 16:04:00 +01:00

17 lines
333 B
Go

package resources
import (
"github.com/dchest/captcha"
"net/http"
)
func MakeCaptcha() string {
return captcha.NewLen(5)
}
func VerifyCaptcha(r *http.Request) bool {
return captcha.VerifyString(r.FormValue("captchaId"), r.FormValue("captchaSolution"))
}
var ServeCaptcha = captcha.Server(captcha.StdWidth, captcha.StdHeight)