Minor: create dummy string of specific length with better method

This commit is contained in:
ljacqu 2019-08-02 15:29:06 +02:00
parent 61af2a0554
commit c00109074a

View File

@ -2,6 +2,7 @@ package tools.docs.hashmethods;
import ch.jalu.injector.Injector; import ch.jalu.injector.Injector;
import ch.jalu.injector.InjectorBuilder; import ch.jalu.injector.InjectorBuilder;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import fr.xephi.authme.ConsoleLogger; import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.TestHelper; import fr.xephi.authme.TestHelper;
@ -15,7 +16,6 @@ import fr.xephi.authme.security.crypts.description.Recommendation;
import fr.xephi.authme.settings.Settings; import fr.xephi.authme.settings.Settings;
import java.lang.annotation.Annotation; import java.lang.annotation.Annotation;
import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
@ -171,7 +171,7 @@ public class EncryptionMethodInfoGatherer {
@Override @Override
public String computeHash(String password) { public String computeHash(String password) {
// Argon2 produces hashes of 96 characters -> return dummy value with this length // Argon2 produces hashes of 96 characters -> return dummy value with this length
return String.join("", Collections.nCopies(96, ".")); return Strings.repeat(".", 96);
} }
} }
} }