perf:优化slat长度的校验

This commit is contained in:
曾文豪
2023-07-10 09:44:07 +08:00
parent 65beecc330
commit a658298363

View File

@@ -73,7 +73,7 @@ public class EncryptConfig {
* @return
*/
public String passwdCreate(String inputPasswd, String salt) {
if (StrUtil.isEmpty(salt)) {
if (StrUtil.isEmpty(salt) || StrUtil.length(salt) != getSaltSize()) {
salt = RandomUtil.randomString(saltSize);
}
if (!passwdComplexity(inputPasswd)) {