def hash_file(upload_context):
    """
    Function run by HashFileCommand to calculate a file hash.
    :param upload_context: PathData: contains path to a local file to hash
    :return HashData: result of hash (alg + value)
    """
    path_data = upload_context.params
    hash_data = path_data.get_hash()
    return hash_data