mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2025-01-11 02:17:33 +01:00
PseudoRandom
This commit is contained in:
parent
2514ae9852
commit
5f2feedebb
@ -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;
|
||||||
|
@ -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() {
|
||||||
|
Loading…
Reference in New Issue
Block a user