def hexify(value):
    """ Takes variously formatted hex values and outputs them as a int """
    out = 0
    if value:
        out = int(value.replace('0x', ''), 16) if isinstance(value, str
            ) else value
    return out
