def bytes_to_int(data):
    """Conversion method for retrieving a uniform way of representing data

    :param data: Can be a bytestring, bytes or int
    :return: Value represented as integer
    :rtype: int
    """
    try:
        # Try for int from bytes
        return int.from_bytes(data, "big")
    except TypeError:
        # Probably got an integer
        if not isinstance(data, int):
            raise TypeError(
                "Given data does not represent something we can convert to an integer | Given [{}]".format(data))
        return data