def int2hexstr(num, intsize=4):
 if (intsize == 8):
  if (num < 0):
   result = struct.pack('<q', num)
  else:
   result = struct.pack('<Q', num)
 elif (num < 0):
  result = struct.pack('<l', num)
 else:
  result = struct.pack('<L', num)
 return result

def int2hexstr ( num , intsize = 4 ) : if ( intsize == 8 ) : if ( num < 0 ) : result = struct . pack ( '<q' , num ) else : result = struct . pack ( '<Q' , num ) elif ( num < 0 ) : result = struct . pack ( '<l' , num ) else : result = struct . pack ( '<L' , num ) return result
convert a number to hexified string .