def int_to_hex(value, octets=2):
    """ hex representation as network order with size of ``octets``
    ex) int_to_hex(1)     # => "0001"
        int_to_hex(32, 4) # => "00000020"
    """
    return ('%%0%dx' % (octets * 2)) % value