package com.guwan.backend; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.security.crypto.password.PasswordEncoder; @SpringBootTest public class Test1 { @Autowired private PasswordEncoder passwordEncoder; @Test void test1() { System.out.println(passwordEncoder.encode("11")); //$2a$10$lo6ix.3XY9orNFDBEMDaJuDojHn8yfADjxxRDjUaxG1d.qkDkecJG System.out.println(passwordEncoder.matches("11", "$2a$10$lo6ix.3XY9orNFDBEMDaJuDojHn8yfADjxxRDjUaxG1d.qkDkecJG")); } }