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

image.go make func encodedPNG() to EncodedPNG() #20

Closed
zhuxiujia opened this issue Sep 9, 2018 · 2 comments
Closed

image.go make func encodedPNG() to EncodedPNG() #20

zhuxiujia opened this issue Sep 9, 2018 · 2 comments
Labels

Comments

@zhuxiujia
Copy link

zhuxiujia commented Sep 9, 2018

in image.go
make func encodedPNG() []byte to EncodedPNG() []byte,
it can support other http framework like "iris" "gin" !!!

and
1.
I recommend separate storage interfaces and image generator ,and delete storage interface,
For example,
com.google.code.kaptcha,
it only do the createText(),createImage().
other job like storage, i will choose like "redis" "mysql" "mongo"....

do not use "Id",and do not use "captcha.VerifyString(id string, digits string)" ,
I think the id just like session,but some people like me will use phone to Instead of id,and use
custom validation

@zhuxiujia zhuxiujia changed the title image.go return []byte image.go make func encodedPNG() to EncodedPNG() Sep 9, 2018
@dchest
Copy link
Owner

dchest commented Jul 24, 2019

  • You can WriteTo image into the bytes buffer to get PNG []byte.

  • You can use SetCustomStore to add a custom storage layer, including redis, mysql, mongo, or any other storage.

  • ID is not a username or phone number, it's a captcha ID — random string. It is important for security. Use the ID returned by New, don't invent your custom ids, please.

@dchest dchest closed this as completed Jul 24, 2019
@dchest dchest added the invalid label Jul 24, 2019
@mxyue
Copy link

mxyue commented Jan 9, 2020

EncodedPNG() is useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants