pool

package
v0.0.0-...-6b6eb93 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PngImage  = 1
	JpegImage = 2
)

Variables

View Source
var StdChars = []byte("0123456789")

Functions

This section is empty.

Types

type CImage

type CImage struct {
	*image.Paletted
	// contains filtered or unexported fields
}

func NewCImage

func NewCImage(numWidth, numHeight, dotSize int) *CImage

func (*CImage) ProductCImage

func (m *CImage) ProductCImage(id string, words []byte, width, height int)

func (*CImage) WriteToJpeg

func (m *CImage) WriteToJpeg(w io.Writer) (int64, error)

WriteTo writes captcha image in PNG format into the given writer.

func (*CImage) WriteToPng

func (m *CImage) WriteToPng(w io.Writer) (int64, error)

WriteTo writes captcha image in PNG format into the given writer.

type CaptchaBody

type CaptchaBody struct {
	Id   string
	Data *bytes.Buffer
	Val  []byte
}

type CaptchaPool

type CaptchaPool struct {
	// contains filtered or unexported fields
}

func NewCaptchaPool

func NewCaptchaPool(width, height, wordLength, poolsize, parallelNum, imageType int) *CaptchaPool

func (*CaptchaPool) GenImage

func (p *CaptchaPool) GenImage()

func (*CaptchaPool) GenRandomWords

func (p *CaptchaPool) GenRandomWords()

func (*CaptchaPool) GetImage

func (p *CaptchaPool) GetImage() *CaptchaBody

func (*CaptchaPool) Stop

func (p *CaptchaPool) Stop()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL