-## Copyright 2002-2003 Andrew Loewenstern, All Rights Reserved
-# see LICENSE.txt for license information
"""Represents a node in the DHT.
from util import compact
# magic id to use before we know a peer's id
-NULL_ID = 20 * '\0'
+NULL_ID = khash.HASH_LENGTH * '\0'
class Node:
"""Encapsulate a node's contact info.
if type(a) == InstanceType:
a = a.num
return self.num != a
+ def __hash__(self):
+ return hash(self.num)
class TestNode(unittest.TestCase):