def hex2(n):
    """
    Pads zeroes to an int so that the returned value has an even numbered length.
    Examples: 1 -> "0x01", 100 -> "0x64", 255 -> "0xff", 256 -> "0x0100"
    :param n: The int value to convert.
    :return: Hex representation of n with "0x" prepended.
    """
    x = '%x' % (n,)
    return '0x' + ('0' * (len(x) % 2)) + x