all repos — captcha @ e5198f7c89b63484499944f63a04829966e37371

Go package captcha implements generation and verification of image and audio CAPTCHAs.

capgen: fix build, add "lang" flag.
Dmitry Chestnykh dmitry@codingrobots.com
Wed, 29 Jun 2011 15:51:37 +0200
commit

e5198f7c89b63484499944f63a04829966e37371

parent

dc1ad84bc9d81902ba2b7db499138bb4d3b51df4

1 files changed, 2 insertions(+), 1 deletions(-)

jump to
M capgen/main.gocapgen/main.go

@@ -17,6 +17,7 @@

var ( flagImage = flag.Bool("i", true, "output image captcha") flagAudio = flag.Bool("a", false, "output audio captcha") + flagLang = flag.String("lang", "en", "language for audio captcha") flagLen = flag.Int("len", captcha.DefaultLen, "length of captcha") flagImgW = flag.Int("width", captcha.StdWidth, "image captcha width") flagImgH = flag.Int("height", captcha.StdHeight, "image captcha height")

@@ -43,7 +44,7 @@ var w io.WriterTo

d := captcha.RandomDigits(*flagLen) switch { case *flagAudio: - w = captcha.NewAudio(d) + w = captcha.NewAudio(d, *flagLang) case *flagImage: w = captcha.NewImage(d, *flagImgW, *flagImgH) }