Here you can find the source of getSaltString()
public static String getSaltString()
//package com.java2s; //License from project: Open Source License import java.util.Random; public class Main { public static String getSaltString() { String SALTCHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; StringBuilder salt = new StringBuilder(); Random rnd = new Random(); while (salt.length() < 18) { int index = (int) (rnd.nextFloat() * SALTCHARS.length()); salt.append(SALTCHARS.charAt(index)); }/*from w w w .ja v a2 s . c om*/ String saltStr = salt.toString(); return saltStr; } }