Java Random Number generateSaltNumber()

Here you can find the source of generateSaltNumber()

Description

generate Salt Number

License

Open Source License

Declaration

public static String generateSaltNumber() 

Method Source Code

//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();
    }
}

Related

  1. generateRandomNumber(int min, int max)
  2. generateRandomNumber(int min, int max)
  3. generateRandomNumber(int start, int end)
  4. generateRandomNumberBetween(final int low, final int high)
  5. generateRandomNumericString(int maxLength)
  6. genRandomNum(int pwd_len)
  7. genRandomNumber()
  8. genRandomNumber(int begin, int end)
  9. genRandomNumber(int digitNumber)