add some comments for captcha

This commit is contained in:
slene
2014-01-16 21:34:59 +08:00
parent f419c12427
commit 91cbe1f29b
2 changed files with 80 additions and 10 deletions

View File

@@ -1,3 +1,4 @@
// modifiy and integrated to Beego from https://github.com/dchest/captcha
package captcha
import (
@@ -240,10 +241,16 @@ func getrand() *rand.Rand {
}
func randIntn(max int) int {
if max <= 0 {
return 0
}
return getrand().Intn(max)
}
func randInt(min, max int) int {
if max-min <= 0 {
return 0
}
return getrand().Intn(max-min) + min
}