Fix code style

This commit is contained in:
Marcus Da Coregio 2023-09-29 13:52:04 -03:00
parent 07b6c451fd
commit 6c9cb47125
1 changed files with 3 additions and 2 deletions

View File

@ -58,12 +58,13 @@ final class Argon2EncodingUtils {
*/
static String encode(byte[] hash, Argon2Parameters parameters) throws IllegalArgumentException {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(switch (parameters.getType()) {
String type = switch (parameters.getType()) {
case Argon2Parameters.ARGON2_d -> "$argon2d";
case Argon2Parameters.ARGON2_i -> "$argon2i";
case Argon2Parameters.ARGON2_id -> "$argon2id";
default -> throw new IllegalArgumentException("Invalid algorithm type: " + parameters.getType());
});
};
stringBuilder.append(type);
stringBuilder.append("$v=")
.append(parameters.getVersion())
.append("$m=")