code: def field_to_long(value):
          
          if isinstance(value, (int, long)):
              return long(value)
          elif isinstance(value, basestring):
              return bytes_to_long(from_hex(value))
          else:
              return None
docs: Converts given value to long if possible, otherwise None is returned.
  
          :param value:
          :return: