better random

This commit is contained in:
tobiasKaminsky 2017-11-23 13:08:20 +01:00
parent cd0bebf45e
commit 042d0ea23a
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7

View file

@ -72,6 +72,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
@ -597,7 +598,7 @@ public class EncryptionUtils {
ArrayList<String> outputLines = new ArrayList<>();
for (int i = 0; i < count; i++) {
int randomLine = (int) (random.nextDouble() * lines.size());
int randomLine = new Random().nextInt(lines.size());
outputLines.add(lines.get(randomLine));
}