all repos — captcha @ 0a3f3296763e7bfb73b624c8d52fa3dfc413a1f2

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

font.go (view raw)

  1package captcha
  2
  3const (
  4	fontWidth  = 11
  5	fontHeight = 18
  6	blackChar  = 1
  7)
  8
  9var font = [][]byte{
 10	{ // 0
 11		0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0,
 12		0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0,
 13		0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0,
 14		0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0,
 15		1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0,
 16		1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1,
 17		1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1,
 18		1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1,
 19		1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1,
 20		1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1,
 21		1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1,
 22		1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1,
 23		1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1,
 24		1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1,
 25		0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0,
 26		0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0,
 27		0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0,
 28		0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0,
 29	},
 30	{ // 1
 31		0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0,
 32		0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0,
 33		0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0,
 34		0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0,
 35		0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0,
 36		0, 0, 1, 0, 0, 1, 1, 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