Here you can find the source of generateSaltNumber()
public static String generateSaltNumber()
//package com.java2s; //License from project: Open Source License import java.util.Random; public class Main { private static final byte SALT_NUMBER_SIZE = 5; public static String generateSaltNumber() { Random random = new Random(System.nanoTime()); StringBuilder saltNumber = new StringBuilder(); for (byte i = 0; i < SALT_NUMBER_SIZE; i++) { saltNumber.append(random.nextInt(10)); }/*from w w w.j a v a 2 s.co m*/ return saltNumber.toString(); } }