Java Salt Value Create getSaltString()

Here you can find the source of getSaltString()

Description

get Salt String

License

Open Source License

Declaration

public static String getSaltString() 

Method Source Code

//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;

    }
}

Related

  1. getMd5Salt()
  2. getNewSalt()
  3. getSalt()
  4. getSaltDES(int snmpEngineBoots)
  5. getSaltedString(String in)