Limit to 1 capital letter to avoid issues with caps filter

This commit is contained in:
Teriuihi 2023-11-28 07:22:35 +01:00
parent b91c9418fb
commit ed99d1c83c

View File

@ -15,8 +15,17 @@ public class Authentication {
StringBuilder salt = new StringBuilder();
Random rnd = new Random();
boolean hasCaps = false;
while (salt.length() < 6) {
int index = (int) (rnd.nextFloat() * (float) randChars.length());
if (index < 26) { //Hot fix for too many caps and the chat filter blocking it
if (hasCaps) {
index += 26;
} else {
hasCaps = true;
}
}
salt.append(randChars.charAt(index));
}