From: aaronsw Date: Thu, 28 Nov 2002 18:00:24 +0000 (+0000) Subject: oops, forgot to test. fixed little bugs X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1805dae6a4c0b56dda88413ce3b80a945d06300c;p=quix0rs-apt-p2p.git oops, forgot to test. fixed little bugs --- diff --git a/hash.py b/hash.py index b6e1f29..bc68686 100644 --- a/hash.py +++ b/hash.py @@ -6,7 +6,7 @@ import whrandom def intify(hstr): """20 bit hash, big-endian -> long python integer""" assert len(hstr) == 20 - return long(hstr.encode('hex'), 16)) + return long(hstr.encode('hex'), 16) def stringify(int): """long int -> 20-character string""" @@ -24,7 +24,7 @@ def distance(a, b): def newID(): - """returns a new pseudorandom globally unique ID string""" + """returns a new pseudorandom globally unique ID string""" h = sha() for i in range(20): h.update(chr(whrandom.randrange(0,256)))