Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

设置字符集为英文字母时,验证容易报错 #12

Closed
fqw123 opened this issue Sep 11, 2023 · 1 comment
Closed

设置字符集为英文字母时,验证容易报错 #12

fqw123 opened this issue Sep 11, 2023 · 1 comment

Comments

@fqw123
Copy link

fqw123 commented Sep 11, 2023

  1. 设置英文字符集

chars := "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"

_ = capt.SetRangChars(strings.Split(chars, ""))

capt = captcha.GetCaptcha()

dots, b64, tb64, key, err := capt.Generate()

  1. 前端点选结果

{"dot":"110,198,48,88,197,72","key":"c39190357e6e59043729c59a8fa99a71"}
image

  1. 实际点选结果
    {"0":{"Index":0,"Dx":105,"Dy":227,"Size":38,"Width":38,"Height":38,"Text":"N","Angle":330,"Color":"#fcb08e","Color2":"#6e3700"},"1":{"Index":1,"Dx":50,"Dy":111,"Size":31,"Width":31,"Height":31,"Text":"A","Angle":20,"Color":"#60c1ff","Color2":"#6e3700"},"2":{"Index":2,"Dx":193,"Dy":96,"Size":37,"Width":37,"Height":37,"Text":"F","Angle":325,"Color":"#b4fed4","Color2":"#660033"}}

期望和汉字的验证效果一致

@wenlng
Copy link
Owner

wenlng commented May 18, 2024

  1. 设置英文字符集

chars := "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"

_ = capt.SetRangChars(strings.Split(chars, ""))

capt = captcha.GetCaptcha()

dots, b64, tb64, key, err := capt.Generate()

  1. 前端点选结果

{"dot":"110,198,48,88,197,72","key":"c39190357e6e59043729c59a8fa99a71"} image

  1. 实际点选结果
    {"0":{"Index":0,"Dx":105,"Dy":227,"Size":38,"Width":38,"Height":38,"Text":"N","Angle":330,"Color":"#fcb08e","Color2":"#6e3700"},"1":{"Index":1,"Dx":50,"Dy":111,"Size":31,"Width":31,"Height":31,"Text":"A","Angle":20,"Color":"#60c1ff","Color2":"#6e3700"},"2":{"Index":2,"Dx":193,"Dy":96,"Size":37,"Width":37,"Height":37,"Text":"F","Angle":325,"Color":"#b4fed4","Color2":"#660033"}}

期望和汉字的验证效果一致

嘿嘿,v2 的位置计算将更精准了,即将发布,可关注一下!

@wenlng wenlng closed this as completed Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants