生成驗證碼的Java類庫:Cage
Cage是一個用于生成驗證碼圖的Java類庫。它具有快速、小型和簡單的特點。其目的是生成,易于人讀取的圖像,但對一臺計算機不可能或至少是非常困難的讀取。


特性
- it is open source, Apache v2 licensed so it can be used in enterprise/proprietary projects too
- it supports maven (available from the central maven repository)
- it is fast (on the test pc 3-5 msec / image)
- it is small (a single, small jar, no external dependencies, only Java 1.5 or newer is needed)
- supports a wide variety of effects (symbol crowding, rotating, ripple - waving, outline shadowing and blurring)
- has two predefined templates that mimics those captchas used by large email providers. See Templates for more info.
- it is simple to use and integrate. See QuickStart for a fast start.
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(); } } }
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!