As a part of my project I need to create non repeating 2 or 3 digit random numbers by giving a set of numbers. I don't want to implement a list or array for that, since I should get 1 random number for each function call.
I tried to do that using SecureRandom class of Java. I got help from some of the sites as well, but I am stuck in between, can we shuffle the VALUES and get it done? But I don't know how that could be done. Can anyone help me?
import java.security.SecureRandom;
public class RandomNumber {
private static final RandomNumber rnd= new RandomNumber();
private static final char[] VALUES = new char[] {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};
private static final SecureRandom srn= new SecureRandom();
public String createID()
{
byte[] bytes = new byte[3];
srn.nextBytes(bytes);
}