Ejemplo n.º 1
0
 /**
  * Generates a new nonce. The <code>isValidNonce</code> method will return true when using nonces
  * generated by this method.
  *
  * @return a unique nonce
  */
 public String generateNonce() {
   String nonce = String.valueOf(nonceGenerator.nextLong());
   nonceCache.put(nonce, System.currentTimeMillis());
   return nonce;
 }
Ejemplo n.º 2
0
 public String getFiveDigitRandomNo() {
   Random r = new Random(System.currentTimeMillis());
   int tempRandomVal = 10000 + r.nextInt(20000);
   return String.valueOf(tempRandomVal);
 }