generate salt value by using given string.
salt was generated as following format
String format of current time + given string + hostname
345913
public static byte[] generateSalt(String saltString) {
        byte[] output = null;
        if (saltString == null || saltString.length() < 1) {
            // use randomly generated value
            output = new byte[SEED_LENGTH];
            SecureRandom rand = new SecureRandom();
            rand.setSeed(rand.generateSeed(SEED_LENGTH));
            rand.nextBytes(output);
        } else {
            try {
                output = saltString.getBytes("UTF-8");
            } catch (UnsupportedEncodingException e) {
                // fall back to default encoding. since the value won't be converted to the string, this is not an issue.
                output = saltString.getBytes();
            }
        }
        return output;
    }
589650
def set_(conn,
         key,
         value,
         time=DEFAULT_TIME,
         min_compress_len=DEFAULT_MIN_COMPRESS_LEN):
    '''
    
    '''
    if not isinstance(time, integer_types):
        raise SaltInvocationError('\'time\' must be an integer')
    if not isinstance(min_compress_len, integer_types):
        raise SaltInvocationError('\'min_compress_len\' must be an integer')
    _check_stats(conn)
    return conn.set(key, value, time, min_compress_len)
897367
public static function hash($string)
    {
        $salt = self::createSalt();
        return self::PREFIX.$salt.'$'.self::createSubHash($string, $salt);
    }
300339
@Override
    public String generate(@Sensitive char[] password) {
        byte[] salt = generateSalt(generateSaltSize);
        byte[] outputBytes = generate(SUPPORTED_ALGORITHMS.get(generateAlgorithm), generateIterations, generateKeySize, salt, password);
        return format(SUPPORTED_ALGORITHMS.get(generateAlgorithm), generateIterations, salt, outputBytes);
    }
1120813
def set_(key,
         value,
         host=DEFAULT_HOST,
         port=DEFAULT_PORT,
         time=DEFAULT_TIME,
         min_compress_len=DEFAULT_MIN_COMPRESS_LEN):
    '''
    
    '''
    if not isinstance(time, six.integer_types):
        raise SaltInvocationError('\'time\' must be an integer')
    if not isinstance(min_compress_len, six.integer_types):
        raise SaltInvocationError('\'min_compress_len\' must be an integer')
    conn = _connect(host, port)
    _check_stats(conn)
    return conn.set(key, value, time, min_compress_len)
1042159
def _kput(url, data):
    '''  '''

    # Prepare headers
    headers = {"Content-Type": "application/json"}
    # Make request
    ret = http.query(url,
                     method='PUT',
                     header_dict=headers,
                     data=salt.utils.json.dumps(data))
    # Check requests status
    if ret.get('error'):
        return ret
    else:
        return salt.utils.json.loads(ret.get('body'))
1374079
public String deriveKeyFormatted(String inputPassword) {
		PBKDF2Parameters p = getParameters();
		byte[] salt = generateSalt();
		p.setSalt(salt);
		p.setDerivedKey(deriveKey(inputPassword));
		String formatted = getFormatter().toString(p);
		return formatted;
	}
597195
def generate_slug(value):
    
    alphabet = app_settings.SLUG_ALPHABET
    salt = app_settings.SLUG_SALT

    hashids = Hashids(alphabet=alphabet, salt=salt, min_length=5)

    return hashids.encode(value)
763591
def generate_string_to_sign(date, region, canonical_request):
    
    formatted_date_time = date.strftime("%Y%m%dT%H%M%SZ")

    canonical_request_hasher = hashlib.sha256()
    canonical_request_hasher.update(canonical_request.encode('utf-8'))
    canonical_request_sha256 = canonical_request_hasher.hexdigest()
    scope = generate_scope_string(date, region)

    return '\n'.join([_SIGN_V4_ALGORITHM,
                      formatted_date_time,
                      scope,
                      canonical_request_sha256])
1080227
def loads_with_timestamp(value, salt):
    """"""
    try:
        signing.loads(value, salt=salt, max_age=-999999)
    except signing.SignatureExpired as e:
        age = float(str(e).split('Signature age ')[1].split(' >')[0])
        timestamp = timezone.now() - datetime.timedelta(seconds=age)
        return timestamp, signing.loads(value, salt=salt)
1191821
public static String createHash(char[] password) throws NoSuchAlgorithmException, InvalidKeySpecException {

    final SecureRandom random = new SecureRandom();
    final byte[] salt = new byte[SALT_BYTES];
    random.nextBytes(salt);

    final byte[] hash = pbkdf2(password, salt, PBKDF2_ITERATIONS, HASH_BYTES);
    // format iterations:salt:hash
    return PBKDF2_ITERATIONS + ":" + toHex(salt) + ":" + toHex(hash);
  }
435495
def write(key, value):
    '''
    
    '''
    try:
        key = target(key)
        log.trace('Writing %s to %s', value, key)
        with salt.utils.files.fopen(key, 'w') as twriter:
            twriter.write(
                salt.utils.stringutils.to_str('{0}\n'.format(value))
            )
            return True
    except Exception:
        return False
586935
def gen_hash(crypt_salt=None, password=None, algorithm='sha512'):
    '''
    
    '''
    if not HAS_CRYPT:
        raise SaltInvocationError('No crypt module for windows')

    hash_algorithms = dict(
        md5='$1$', blowfish='$2a$', sha256='$5$', sha512='$6$'
    )
    if algorithm not in hash_algorithms:
        raise SaltInvocationError(
            'Algorithm \'{0}\' is not supported'.format(algorithm)
        )

    if password is None:
        password = secure_password()

    if crypt_salt is None:
        crypt_salt = secure_password(8)

    crypt_salt = hash_algorithms[algorithm] + crypt_salt

    return crypt.crypt(password, crypt_salt)
533608
def format_value(self):
        
        return format_value(
            self.data_type,
            self.data,
            self.parent.stringpool_main.getString
        )
615373
def generate_password_hash(password, digestmod='sha256', salt_length=8):
    

    salt = ''.join(random.sample(SALT_CHARS, salt_length))
    signature = create_signature(salt, password, digestmod=digestmod)
    return '$'.join((digestmod, salt, signature))
119345
private String format(String algorithm, int iterations, byte[] salt, byte[] value) {
        final char COLON = ':';
        StringBuffer sb = new StringBuffer(algorithm);
        sb.append(COLON).append(iterations).append(COLON).append(Base64Coder.base64EncodeToString(salt)).append(COLON).append(Base64Coder.base64EncodeToString(value));
        return sb.toString();
    }
830273
public static function generateSalt(
        $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',
        $saltLength = 30
    ){
        return substr(str_shuffle(str_repeat((string) $chars,10)),0, (int) $saltLength);
    }