Here you can find the source of randomAlphaNumeric(int length)
public static String randomAlphaNumeric(int length)
//package com.java2s; /******************************************************************************* * Created by Carlos Yaconi/*from w ww . j a v a 2s .c o m*/ * Copyright 2012 Fork Ltd. All rights reserved. * License: GPLv3 * Full license at "/LICENSE" ******************************************************************************/ public class Main { public static String randomAlphaNumeric(int length) { StringBuffer buffer = new StringBuffer(); String characters = "abcdefghijklmnopqrstuvwxyz0123456789"; int charactersLength = characters.length(); for (int i = 0; i < length; i++) { double index = Math.random() * charactersLength; buffer.append(characters.charAt((int) index)); } return buffer.toString(); } }