Documentation
¶
Overview ¶
Package captcha 提供图形验证码:生成 PNG + 答案存储与校验。 底层基于 base64Captcha(Go 生态主流);答案默认内存存储(带 TTL 与限次), 可注入自定义 Store(如 Redis 分布式校验)。 场景:登录/注册防刷、短信发送前置验证。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator 验证码生成器。
func (*Generator) Generate ¶
Generate 生成验证码,返回 (id, base64 PNG 数据, 错误)。 前端:<img src="data:image/png;base64,<data>">。
Click to show internal directories.
Click to hide internal directories.