'Called for the key object for dictionary operations, and by
the built-in function hash(). Should return a 32-bit integer
usable as a hash value for dictionary operations. The only
required property is that objects which compare equal have the
same hash value
>>> IP(\'10.0.0.0/24\').__hash__()
-167772185'

def __hash__(self):

    thehash = int((-1))
    ip = self.ip
    while (ip > 0):
        thehash = (thehash ^ (ip & 2147483647))
        ip = (ip >> 32)
    thehash = (thehash ^ self._prefixlen)
    return int(thehash)
