all repos — captcha @ 34dcf8d144dd8c7323d3abdefa08b46d05abc4f3

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

Better error descriptions.
Dmitry Chestnykh dmitry@codingrobots.com
Sun, 08 May 2011 12:14:43 +0200
commit

34dcf8d144dd8c7323d3abdefa08b46d05abc4f3

parent

f0b06e6dfcab8fc3f846af56afb225191026b4ed

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

jump to
M captcha.gocaptcha.go

@@ -58,7 +58,7 @@ Expiration = 10 * 60 // 10 minutes

) var ( - ErrNotFound = os.NewError("captcha with the given id not found") + ErrNotFound = os.NewError("captcha: id not found") // globalStore is a shared storage for captchas, generated by New function. globalStore = NewMemoryStore(CollectNum, Expiration) )
M random.gorandom.go

@@ -32,7 +32,7 @@ // randomBytes returns a byte slice of the given length read from CSPRNG.

func randomBytes(length int) (b []byte) { b = make([]byte, length) if _, err := io.ReadFull(crand.Reader, b); err != nil { - panic("error reading random source: " + err.String()) + panic("captcha: error reading random source: " + err.String()) } return }