Java Salt Value Create getSalt()

Here you can find the source of getSalt()

Description

get Salt

License

Open Source License

Declaration

public static String getSalt() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Random;

public class Main {
    private static final String[] SALEARR = { "q", "a", "z", "w", "s", "x", "e", "d", "c", "r", "f", "v", "t", "g",
            "b", "y", "h", "n", "u", "j", "m", "i", "k", "o", "l", "p", "_" };

    public static String getSalt() {
        Random random = new Random();
        StringBuilder sb = new StringBuilder("");
        for (int i = 0; i < 6; i++) {
            sb.append(SALEARR[random.nextInt(26)]);
        }/*w  w w  .  j  av  a2s . c  o  m*/
        return sb.toString();
    }
}

Related

  1. generateSaltedPassword(final String password, byte[] salt, int iterationsCount, String hmacName)
  2. generateSaltedSHAHash(String algorithm, String input, String salt)
  3. generateSaltOfLength(int length)
  4. getMd5Salt()
  5. getNewSalt()
  6. getSaltDES(int snmpEngineBoots)
  7. getSaltedString(String in)
  8. getSaltString()