EasyCaptcha
EasyCaptcha copied to clipboard
Java图形验证码,支持gif、中文、算术等类型,可用于Java Web、JavaSE等项目。
```java SpecCaptcha captcha = new SpecCaptcha(130, 48, 4); System.out.println(captcha.toBase64()); 调用 captcha.toBase64() 方法 会导致系统内存持续上涨,求解决方案 ```
做了一个简单的压测,普通字母png比中文png慢很多,数据如下: https://github.com/power4j/java-perf/tree/master/easy-captcha 使用内建字体的时候,创建字体消耗了 30%的时间,是不是可以缓存一下,担心资源占用可以加个开关选项。  使用中文验证码,没有创建字体就好多了。 
Warning: Nashorn engine is planned to be removed from a future JDK release
我知道是因为fontconfig这个东西,我想说的是可否改成不依赖这个fontconfig,这样就无需对程序运行环境进行修改了 (google的captcha有同样的这个问题)
我原本使用 ``` com.github.whvcse easyCaptcha 1.5.0 ``` 现在中央仓库已经没有这个包了。(https://repo1.maven.org/maven2/com/github/whvcse/) 每次一联网打包,就报错了 ``` [ERROR] Failed to execute goal on project mvc: Could not resolve dependencies for project : Could not find artifact com.github.whvcse:EasyCaptcha:jar:1.5.0 in...
部分符号无法展示
之前我也写了一个类似的验证码工具,想参考下作者的漂亮字体,测试算术计算验证码发现有部分字体无法展示+、-、=符号
## 描述 1. 正常调试无问题 2. 打包成 docker 后,报空指针 ## docker file ``` FROM frolvlad/alpine-oraclejdk8:slim # 包与运行 RUN mkdir /data ADD ./target/mini-admin-0.0.1-SNAPSHOT.jar /data/app.jar EXPOSE 8080 ENTRYPOINT ["java", "-jar", "-server", "-Xmx2048m", "-Xms2048m","-Dspring.profiles.active=prod",...
java.io.IOException: Problem reading font data. at java.awt.Font.createFont0(Font.java:1000) ~[?:1.8.0_111-internal] at java.awt.Font.createFont(Font.java:877) ~[?:1.8.0_111-internal] at com.wf.captcha.base.Captcha.setFont(Captcha.java:277) ~[easy-captcha-1.6.2.jar!/:?] at com.wf.captcha.base.Captcha.setFont(Captcha.java:273) ~[easy-captcha-1.6.2.jar!/:?] at com.wf.captcha.base.Captcha.setFont(Captcha.java:269) ~[easy-captcha-1.6.2.jar!/:?] docker里没有字体?
对算数型验证码进行测试: ` for (int i = 0; i < 100; i++) { Captcha captcha = new ArithmeticCaptcha(111, 36, 3); System.out.println(captcha.text()); } ` 测试的结果中,少部分结果是浮点型,这样前端输验证码是肯定匹配错误的 7.0 1 -10 2.0 24 16 7...