I am trying to create a random number use SecureRandom. It must be digits only (0123456789) and be 12 characters long. Any help would be greatly appreciated.
SecureRandom secureRandom = new SecureRandom();
synchronized (secureRandom) {
final byte[] random = new byte[12];
secureRandom.nextBytes(random);
return Base64.encodeBase64URLSafeString(random);
}
I am getting the following:
IHmv_qsWMZ0teI_-