<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def hash_data(salt, value, hash_alg=None):
 """ Hashes a value together with a salt with the given hash algorithm. :type salt: str :type hash_alg: str :type value: str :param salt: hash salt :param hash_alg: the hash algorithm to use (default: SHA512) :param value: value to hash together with the salt :return: hashed value """

    hash_alg = hash_alg or 'sha512'
    hasher = hashlib.new(hash_alg)
    hasher.update(value.encode('utf-8'))
    hasher.update(salt.encode('utf-8'))
    value_hashed = hasher.hexdigest()
    return value_hashed