all repos — captcha @ b8bb54f620c035b64cc72975cb78fa2fcf4fa261

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

image: simplify skew randomization.

Use rndf instead of rand.Float64 voodoo.
Dmitry Chestnykh dmitry@codingrobots.com
Wed, 27 Apr 2011 15:55:36 +0200
commit

b8bb54f620c035b64cc72975cb78fa2fcf4fa261

parent

a6788822d7fb0a37e90eb280867c61958737d746

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

jump to
M image.goimage.go

@@ -161,7 +161,7 @@ }

} func (img *Image) drawDigit(digit []byte, x, y int) { - skf := rand.Float64() * float64(rnd(-maxSkew, maxSkew)) + skf := rndf(-maxSkew, maxSkew) xs := float64(x) minr := img.dotSize / 2 // minumum radius maxr := img.dotSize/2 + img.dotSize/4 // maximum radius