PseudoRandom

This commit is contained in:
Xephi 2015-05-28 20:09:14 +02:00
parent 2514ae9852
commit 5f2feedebb
2 changed files with 3 additions and 0 deletions

View File

@ -1,6 +1,7 @@
package fr.xephi.authme.commands; package fr.xephi.authme.commands;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.util.Random;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.command.Command; import org.bukkit.command.Command;

View File

@ -1,5 +1,6 @@
package fr.xephi.authme.security; package fr.xephi.authme.security;
import java.util.Calendar;
import java.util.Random; import java.util.Random;
/** /**
@ -25,6 +26,7 @@ public class RandomString {
if (length < 1) if (length < 1)
throw new IllegalArgumentException("length < 1: " + length); throw new IllegalArgumentException("length < 1: " + length);
buf = new char[length]; buf = new char[length];
random.setSeed(Calendar.getInstance().getTimeInMillis());
} }
public String nextString() { public String nextString() {