package
0.0.0-20240717101430-769106d90faf
Repository: https://github.com/phylaxis-net/go-captcha.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# Functions

CheckPointDist is a function* * @Description: 计算点的位置在区域是否命中 * @param sx 用户点击的x轴 * @param sy 用户点击的y轴 * @param dx 校验文本的x轴 * @param dy 校验文本的y轴 * @param width 校验文本的宽度 * @param height 校验文本的高度 * @return bool */.
CheckPointDistWithPadding is a function* * @Description: 计算点的位置在扩张区域(原区域+外边距)是否命中 * @param sx 用户点击的x轴 * @param sy 用户点击的y轴 * @param dx 校验文本的x轴 * @param dy 校验文本的y轴 * @param width 校验文本的宽度 * @param height 校验文本的高度 * @param padding 在原有的区域上添加额外边距进行扩张计算区域,不推荐设置过大的padding * @return bool */.
Child is a function* * @Description: 获取路径 * @param path * @return []string */.
============================================= Call API ============================================= ClearAssetCacheWithPaths is a function* * @Description: 根据路径清除资源缓存 * @param paths * @return bool */.
EncodeB64string is a function* * @Description: base64编码 * @param img 图片 * @param quality 清晰度 * @return string */.
EncodeB64string is a function* * @Description: base64编码 * @param img * @return string */.
No description provided by the author
GetCaptcha is a function* * @Description: 获取点选验证码,是安全的 * @return *Captcha */.
GetCaptchaDefaultChars is a type* * @Description: 获取字符 * @return map[int]string */.
GetCaptchaDefaultConfig is a type* * @Description: 获取默认配置 * @return CaptchaConfig */.
HexToRgb is a function* * @Description: 十六进制转RBG颜色 * @param hex * @return int64 * @return int64 * @return int64 */.
InArrayWithStr is a function* * @Description: InArrayS 如果 s 在 items 中,返回 true;否则,返回 false。 * @param items * @param s * @return bool */.
IsChineseChar is a function* * @Description: 判断是否是中文 * @param str * @return bool */.
LenChineseChar is a function* * @Description: 计算中文及字母长度,例如:“你好hello” = 7 * @param str * @return int */.
Md5ToString is a function* * @Description: Md5 * @param str * @return string */.
NewCaptcha is a function* * @Description: 创建点选验证码 * @return *Captcha */.
NewPalette is a function* * @Description: 创建调色板 * @param r * @param p * @return *Palette */.
ParseHexColor is a function* * @Description: 把十六进制颜色转 color.RGBA * @param v * @return out * @return err */.
PathExists is a function* * @Description: 检测文件是否存在 * @param path * @return bool * @return error */.
RandFloat is a function* * @Description: 随机浮点数 * @param min * @param max * @return float64 */.
RandInt is a function* * @Description: 生成区间[-m, n]的安全随机数 * @param min * @param max * @return int */.
RgbToHex is a function* * @Description: RBG颜色转十六进制颜色 * @param red * @param green * @param blue * @return CaptchaColorHEX */.
Sup is a function* * @Description: 对长度不足n的数字前面补0 * @param int64 * @param int * @return string */.

# Constants

扭曲程度 1-5级别.
* * @Description: 扭曲程度 */.
* * @Description: 扭曲程度 */.
* * @Description: 扭曲程度 */.
* * @Description: 扭曲程度 */.
无扭曲.
质量压缩程度 1-5 级别,压缩级别越低图像越清晰.
* * @Description: 质量压缩程度 */.
* * @Description: 质量压缩程度 */.
* * @Description: 质量压缩程度 */.
* * @Description: 质量压缩程度 */.
无压缩质量,原图.

# Structs

AreaPoint is a type* * @Description: 区域点信息 */.
Captcha is a type* * @Description: 点选验证码 */.
CharDot is a type* * @Description: 图片点数据 */.
Config is a type* * @Description: 验证码配置 */.
Draw is a type* * @Description: 验证码画图 */.
DrawCanvas is a type* * @Description: 验证码画图 */.
DrawDot is a type.
Palette is a type* * @Description: 调色板 */.
Point is a type* * @Description: 点 */.
RangeVal is a type* * @Description: 范围值 * @Example: {min: 0, max: 45} 从0-45中取任意值 */.
Size is a type* * @Description: 尺寸 * @Example: {width: 0, height: 45} 从0-45中取任意值 */.