import pickle
import hashlib


def hash_generator(*args):
    """Generate a hash from a variable number of arguments as a safe string.

    Note that pickle is used so arguments have to be serializable.

    Args:
        *args: arguments to hash

    """
    temp = pickle.dumps(args, pickle.HIGHEST_PROTOCOL)
    return hashlib.md5(temp).hexdigest()