off by one

This commit is contained in:
Michele Balistreri 2021-01-12 11:30:37 +03:00
parent 9c09588b8b
commit 2dc8360b6f
No known key found for this signature in database
GPG Key ID: E9567DA33A4F791A
1 changed files with 1 additions and 1 deletions

View File

@ -72,7 +72,7 @@ public class SmartCardSecrets {
for (int i = 0; i < length; i++) {
char[] src = (i % 2) == 0 ? possibleCharacters : possibleDigits;
int idx = random.nextInt(src.length - 1);
int idx = random.nextInt(src.length);
buffer.append(src[idx]);
}