We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
您给的实例运行后没有问题,但是我想使用curl命令行的方式向生成或者认证函数传递参数,请问我应该怎么传递
The text was updated successfully, but these errors were encountered:
我这里有一个算术公式example代码,看看是否是你需要的
import ( "github.com/mojocn/base64Captcha" "image/color" "time" ) type Captcha struct { Driver base64Captcha.DriverMath Store base64Captcha.Store } func NewCaptcha() *Captcha { d := base64Captcha.DriverMath{ Height: 36, Width: 240, NoiseCount: 0, ShowLineOptions: 0, //base64Captcha.OptionShowSlimeLine,//base64Captcha.OptionShowHollowLine | base64Captcha.OptionShowSineLine | base64Captcha.OptionShowSlimeLine, BgColor: &color.RGBA{ R: 0, G: 0, B: 0, A: 0, }, //transparent background color Fonts: []string{"wqy-microhei.ttc"}, //randomly use all fonts } d.ConvertFonts() //use all fonts return &Captcha{ Driver: d, Store: base64Captcha.NewMemoryStore(1<<20, time.Second*300), } } //Generate generates a random id, base64 image string or an error if any func (c *Captcha) Generate() (id, b64s string, err error) { id, content, answer := c.Driver.GenerateIdQuestionAnswer() item, err := c.Driver.DrawCaptcha(content) if err != nil { return "", "", err } c.Store.Set(id, answer) b64s = item.EncodeB64string() return } //Verify by a given id key and remove the captcha value in store, //return boolean value. //if you has multiple captcha instances which share a same store. //You may want to call `store.Verify` method instead. func (c *Captcha) Verify(id, answer string, clear bool) (match bool) { match = c.Store.Get(id, clear) == answer return }
Sorry, something went wrong.
No branches or pull requests
您给的实例运行后没有问题,但是我想使用curl命令行的方式向生成或者认证函数传递参数,请问我应该怎么传递
The text was updated successfully, but these errors were encountered: