Cage 是一个 Java 实现的验证码图片生成库,快速、小型和简单。
示例代码:
public class QuickStart { public static void main(String[] args) throws IOException { Cage cage = new GCage(); OutputStream os = new FileOutputStream("captcha.jpg", false); try { cage.draw(cage.getTokenGenerator().next(), os); } finally { os.close(); } } }
Maven:
<dependency> <groupId>com.github.cage</groupId> <artifactId>cage</artifactId> <version>1.0</version> </dependency>