0
我注意到Md4PasswordEncoder Spring Security的下面的代碼:的Java Spring Security中的PasswordEncoder
/**
* Takes a previously encoded password and compares it with a raw password after mixing in the salt and
* encoding that value.
*
* @param encPass previously encoded password
* @param rawPass plain text password
* @param salt salt to mix into password
* @return true or false
*/
public boolean isPasswordValid(String encPass, String rawPass, Object salt) {
String pass1 = "" + encPass;
String pass2 = encodePassword(rawPass, salt);
return PasswordEncoderUtils.equals(pass1,pass2);
}
我目前正致力於開發定製的PasswordEncoder。可以請任何人解釋爲什麼春天的開發人員通過向傳入的對象中添加一個空字符串來處理null?
在此先感謝