]> git.mxchange.org Git - quix0rs-apt-p2p.git/blobdiff - hash.py
changed from bsddb3 to pysqlite
[quix0rs-apt-p2p.git] / hash.py
diff --git a/hash.py b/hash.py
index 4210385b5632969095880e38094dab92c0ca1946..9ab4e0b4ef91b6627f624a073adbb945419acc6f 100644 (file)
--- a/hash.py
+++ b/hash.py
@@ -1,7 +1,7 @@
 ## Copyright 2002 Andrew Loewenstern, All Rights Reserved
 
 from sha import sha
-from whrandom import randrange
+import whrandom
 
 ## takes a 20 bit hash, big-endian, and returns it expressed a long python integer
 def intify(hstr):
@@ -27,7 +27,7 @@ def distance(a, b):
 def newID():
     h = sha()
     for i in range(20):
-       h.update(chr(randrange(0,256)))
+       h.update(chr(whrandom.randrange(0,256)))
     return h.digest()
 
 def newIDInRange(min, max):