Java Salt Value Create generateSalt()

Here you can find the source of generateSalt()

Description

Generates a salt for working with passwords.

License

LGPL

Return

A salt

Declaration

public static String generateSalt() 

Method Source Code

//package com.java2s;
/**/*from  w w w  . j a  va 2s  .  c  o  m*/
 * Licensed under the GNU LGPL v.2.1 or later.
 */

import java.math.BigInteger;

import java.security.SecureRandom;

public class Main {
    /**
     * Generates a salt for working with passwords.
     *
     * @return A salt
     */
    public static String generateSalt() {
        return new BigInteger(40, new SecureRandom()).toString(32);
    }
}

Related

  1. generateSalt()
  2. generateSalt()
  3. generateSalt()
  4. generateSalt()
  5. generateSalt()
  6. generateSalt()
  7. generateSalt(final Integer size)
  8. generateSalt(int bits)
  9. generateSalt(int byteSize)