Documentation ¶
Overview ¶
Package captcha implements generation and verification of image CAPTCHAs.
A captcha solution is the sequence of digits 0-9 with the defined length.
Index ¶
Constants ¶
View Source
const ( // StdWidth standard width of a captcha image. StdWidth = 140 // StdHeight standard height of a captcha image. StdHeight = 80 )
View Source
const (
// DefaultLen default number of digits in captcha solution.
DefaultLen = 4
)
Variables ¶
This section is empty.
Functions ¶
func RandomDigits ¶
RandomDigits returns a byte slice of the given length containing pseudorandom numbers in range 0-9. The slice can be used as a captcha solution.
Types ¶
type Controller ¶
type Controller struct { ImgWidth int ImgHeight int ImgLength int controller.JSONController }
Controller captcha controller.
func (*Controller) Verify ¶
func (me *Controller) Verify(c xhttp.Context)
Verify Ajax verify captcha
Click to show internal directories.
Click to hide internal directories.