You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
729 B
Go

package captchafx
import (
"image/color"
"github.com/mojocn/base64Captcha"
)
type Captcha struct {
Math *base64Captcha.Captcha
Digit *base64Captcha.Captcha
}
func NewCaptcha(driverMath *base64Captcha.DriverMath, driverDigit *base64Captcha.DriverDigit, store base64Captcha.Store) *Captcha {
return &Captcha{
Math: &base64Captcha.Captcha{Driver: driverMath, Store: store},
Digit: &base64Captcha.Captcha{Driver: driverDigit, Store: store},
}
}
func NewDriverMath() *base64Captcha.DriverMath {
return base64Captcha.NewDriverMath(40, 334, 1, 2, &color.RGBA{}, base64Captcha.DefaultEmbeddedFonts, []string{})
}
func NewDriverDigit() *base64Captcha.DriverDigit {
return base64Captcha.NewDriverDigit(6, 6, 6, 6, 6)
}