def haddr_to_int(addr):
 try:
  return int(addr.replace(':', ''), 16)
 except:
  raise ValueError

def haddr_to_int ( addr ) : try : return int ( addr . replace ( ':' , '' ) , 16 ) except : raise ValueError
convert mac address string in human readable format into integer value .