List of utility methods to do Password Create
String | generateRandomPassword(int length) generate Random Password StringBuffer sb = new StringBuffer(length); for (int i = 0; i < length; i++) { int index = (int) (RANDOM.nextDouble() * RANDOM_LETTERS.length); sb.append(RANDOM_LETTERS[index]); return sb.toString(); |
String | generatePassword() generate Password int randomInt = new Random().nextInt(1000000); return String.valueOf(randomInt); |
String | generateUsername() generate Username int randomInt = new Random().nextInt(1000000); String username = String.valueOf(randomInt); int len = username.length(); while (len < 6) { username = "0" + String.valueOf(randomInt); len = username.length(); return username; ... |