|
|
@@ -23,7 +23,7 @@ public class passwordTest { |
|
|
|
@Test |
|
|
|
public void test1() { |
|
|
|
String password = "123"; |
|
|
|
String encode = "{bcrypt}" + passwordEncoder.encode(password); |
|
|
|
String encode = passwordEncoder.encode(password); |
|
|
|
System.out.println(encode); |
|
|
|
//$2a$10$K.gyCkGOvQAbBQg.HAai1O5cvE./sVWLCfiLURhCVjhHVt1SSOAi6 |
|
|
|
} |
|
|
@@ -32,7 +32,7 @@ public class passwordTest { |
|
|
|
@Test |
|
|
|
public void test2() { |
|
|
|
String password = "123"; |
|
|
|
String encode = "{bcrypt}$2a$10$apjRNzmuDrDx2DiGAaVaZeM/HzyxMU3bOEWpZwYsbp5nc9jv1A7FK"; |
|
|
|
String encode = "$2a$10$apjRNzmuDrDx2DiGAaVaZeM/HzyxMU3bOEWpZwYsbp5nc9jv1A7FK"; |
|
|
|
boolean matches = passwordEncoder.matches(password, encode); |
|
|
|
System.out.println(matches); |
|
|
|
} |