Happy Captcha simple verification code is an easy-to-use Java verification code software package, designed to spend the shortest time and the least amount of code to implement the verification code function of the Web site.
The Happy Captcha simple verification code provides two display forms: pictures and animations. The verification code content includes Chinese (including 3500 commonly used Chinese characters), Arabic numerals (09), Chinese numerals (zero to nine), and Chinese uppercase numerals (zero to nine). , mixed numbers and letters (09-az-AZ), mixed numbers and lowercase letters (09-az), mixed numbers and uppercase letters (09-AZ), pure lowercase letters, pure uppercase letters, mixed uppercase and lowercase letters, and operational expressions 12 types including formulas (Arabic numeral arithmetic expressions and Chinese arithmetic expressions).
Happy Captcha simple verification code fully complies with the Apache 2.0 open source license agreement. You can use the software freely. If you find any defects in the software when using Happy Captcha, please feel free to contact the author.
Happy Captcha simple verification code installation
If your project uses Maven for dependency management, you only need to add the following configuration to the pom.xml file
com.ramostear
Happy-Captcha
1.0.1
Gradle users can obtain Happy Captcha by introducing the following configuration:
implementation 'com.ramostear:Happy-Captcha:1.0.1'
Happy Captcha simple verification code usage
HappyCaptcha strives to keep the process simple when designing. By default, you only need to write one line of code to generate a beautiful verification code image. The following is an example of using HappyCaptcha
@Controller
public class HappyCaptchaController{
@GetMapping("/captcha")
public void happyCaptcha(HttpServletRequest request,HttpServletResponse response){
HappyCaptcha.require(request,response).build().finish();
}
}
For HappyCaptcha, only request and response are required parameters, and default values can be used for the rest of the parameters.
By default, the verification code generated by HappyCaptcha is displayed in the form of a picture. The content is a random combination of characters from 09-az-A~Z. The character length is 5, the picture width is 160, the height is 50, and the font is Microsoft Yahei.