Spring Security 密码加密及验证

PasswordEncoder passwordEncoder=PasswordEncoderFactories.createDelegatingPasswordEncoder();
String test1=  passwordEncoder.encode("admin");
System.out.println(test1);
String test2=  passwordEncoder.encode("admin");
System.out.println(test2);
System.out.println(passwordEncoder.matches("admin",test1));
System.out.println(passwordEncoder.matches("admin",test2));

你可能感兴趣的:(Spring Security 密码加密及验证)