依赖
<dependency>
<groupId>com.github.whvcse</groupId>
<artifactId>easy-captcha</artifactId>
<version>1.6.2</version>
</dependency>
使用,这是基础使用,详情看github的easyCaptcha
//生成六位数的动态git验证码
GifCaptcha gifCaptcha = new GifCaptcha(130,48,6);
//拿到验证码的内容
String text = gifCaptcha.text();
//把验证码图片转为base64用于前端展示
String s = gifCaptcha.toBase64();
依赖
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-crypto</artifactId>
<version>5.4.2</version>
</dependency>
使用
bCryptPasswordEncoder.encode("0000")
bCryptPasswordEncoder.matches(0000, 加密的);