captcha

package
v0.0.0-...-7bb0158 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultFont, _ = truetype.Parse(fontFile)

默认的字体可重置。

默认的单机存储ttlmap,主要是为了单机开发适配。

View Source
var StoreAlive = 5 * time.Minute

Functions

func NewPngImg

func NewPngImg(option Option) (*bytes.Buffer, error)

func RandText

func RandText(strlen int) string

func Verify

func Verify(id, code string) bool

Types

type Option

type Option struct {
	Width     int
	Height    int
	Text      string
	DPI       float64
	FontSize  float64
	TextColor color.RGBA
}

type VerifyData

type VerifyData struct {
	ID        string
	PngBase64 string
}

func NewImg

func NewImg() (*VerifyData, error)

Jump to

Keyboard shortcuts

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