<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.5.RELEASE</version>
</parent>
<groupId>org.example</groupId>
<artifactId>xxx</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>6</source>
<target>6</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope> </dependency>
</dependencies>
public class mimaTest {
public static void main(String[] args) {
BCryptPasswordEncoder passEncoder =new BCryptPasswordEncoder();
for (int i=0;i<5;i++){
String encode = passEncoder.encode("123456");
boolean matches = passEncoder.matches("123456", encode);
System.out.println(encode+"======>"+matches);
}
}
}
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/3953aca77af2ea70515d8ed7743f3eae.png)