package com.kaviju.accesscontrol.authentication;

import java.util.Random;

public class RandomPasswordGenerator {
	static final String possibleChars = "23456789abcdefghjklmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ@#$%?&*()-+";
	static Random rnd = new Random();

	static public String newPassword(int len) {
		{
			StringBuilder password = new StringBuilder( len );
			for( int i = 0; i < len; i++ ) {
				int nextCharIndex = rnd.nextInt(possibleChars.length());
				password.append(possibleChars.charAt(nextCharIndex));
			}
			return password.toString();
		}		
	}
}

@@ -216,16 +216,68 @@
 *()-+%22;%0A
+%09static final String possibleDigits = %220123456789%22;%0A
 %09static 
@@ -606,11 +606,323 @@
 %09%09%7D%09%09%0A%09%7D
+%0A%0A%09static public String newDigitsPassword(int len) %7B%0A%09%09%7B%0A%09%09%09StringBuilder password = new StringBuilder( len );%0A%09%09%09for( int i = 0; i %3C len; i++ ) %7B%0A%09%09%09%09int nextCharIndex = rnd.nextInt(possibleDigits.length());%0A%09%09%09%09password.append(possibleDigits.charAt(nextCharIndex));%0A%09%09%09%7D%0A%09%09%09return password.toString();%0A%09%09%7D%09%09%0A%09%7D
 %0A%7D%0A

Add a digits only password generator.