Here you can find the source of getMd5Salt()
public static String getMd5Salt()
//package com.java2s; //License from project: Apache License import java.util.Random; public class Main { public static String getMd5Salt() { return getRandomText(8); }/*from w w w . j a va2 s .c o m*/ public static String getRandomText(int length) { String baseChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; StringBuffer buffer = new StringBuffer(); Random random = new Random(); for (int i = 0; i < length; i++) { buffer.append(baseChars.charAt(random.nextInt(baseChars.length()))); } return buffer.toString(); } }