Giter VIP home page Giter VIP logo

Comments (5)

wenlng avatar wenlng commented on May 20, 2024

No description provided.

你检查一下缩略图的校验文本随机范围长度的 SetRangCheckTextLen 和 主图显示的文本随机范围长度的 SetTextRangLen

from go-captcha.

cavey1230 avatar cavey1230 commented on May 20, 2024

chars := []string{"HE", "CA", "WO", "NE", "HT"}

Capt.SetTextRangLen(captcha.RangeVal{Min: 5, Max: 5})
Capt.SetRangCheckTextLen(captcha.RangeVal{Min: 1, Max: 1})

我现在是这样的

但是还是有概率刷不出来

from go-captcha.

wenlng avatar wenlng commented on May 20, 2024

默认情况下是不需要设置 SetRangChars 的,因为内置有足够多的中文的文本种子。
如果实在需要自定义设置字母的种子,你将种子设置得多一些,最好是超过上百个。
目前你也可以自己写个函数专门生成A-Z由两个字符组成唯一的n多个组合,例如:{"HE", "CA", "WO", "NE", "HT", "IE", "PG", "GI", "CH", "CO", "DA" .... }。
还有就是 SetRangCheckTextLen 别设置那么短,理想是 3-5。

关于生成字母或数字组合的种子函数,在后面的版本中也会考虑加入。

from go-captcha.

cavey1230 avatar cavey1230 commented on May 20, 2024

默认情况下是不需要设置 SetRangChars 的,因为内置有足够多的中文的文本种子。 如果实在需要自定义设置字母的种子,你将种子设置得多一些,最好是超过上百个。 目前你也可以自己写个函数专门生成A-Z由两个字符组成唯一的n多个组合,例如:{"HE", "CA", "WO", "NE", "HT", "IE", "PG", "GI", "CH", "CO", "DA" .... }。 还有就是 SetRangCheckTextLen 别设置那么短,理想是 3-5。

关于生成字母或数字组合的种子函数,在后面的版本中也会考虑加入。

好 我尝试这样做一下 需要ts版本的react 组件吗 可以给你提个pr

from go-captcha.

wenlng avatar wenlng commented on May 20, 2024

感谢对go-captcha库的支持,在v2.0将有ts版的组件

from go-captcha.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.