from typing import Union
import json


def get_hashable_json(thing: Union[dict, list]) -> str:
    """Convert an dict or list to an input ready to be hashable.

    Args:
        thing (Union[dict, list]): [description]

    Returns:
        str: An JSON string ideal for hashing
    Examples:
        >>> import hxlm.core.internal.integrity as HDP_i
        >>> HDP_i.get_hashable_json(['test'])
        '["test"]'
    """
    # json_object = json.load(thing)
    return json.dumps(thing, indent=None, ensure_ascii=False, sort_keys=True)