1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-11 04:30:39 +00:00

add comments for testing, utils and validation packages

This commit is contained in:
傅小黑
2014-02-07 16:07:31 +08:00
parent 846d766499
commit ce2984f09a
9 changed files with 64 additions and 7 deletions

View File

@ -70,6 +70,7 @@ const (
urlPrefix = "/captcha/"
)
// Captcha struct
type Captcha struct {
// beego cache store
store cache.Cache
@ -96,10 +97,12 @@ type Captcha struct {
CachePrefix string
}
// generate key string
func (c *Captcha) key(id string) string {
return c.CachePrefix + id
}
// generate rand chars with default chars
func (c *Captcha) genRandChars() []byte {
return utils.RandomCreateBytes(c.ChallengeNums, defaultChars...)
}