]> git.mxchange.org Git - quix0rs-apt-p2p.git/commitdiff
fix bugs in stringify
authorburris <burris>
Mon, 23 Sep 2002 23:43:43 +0000 (23:43 +0000)
committerburris <burris>
Mon, 23 Sep 2002 23:43:43 +0000 (23:43 +0000)
hash.py

diff --git a/hash.py b/hash.py
index 7f42f3152cd6e0082e24b9058d874a10c18b9a98..4210385b5632969095880e38094dab92c0ca1946 100644 (file)
--- a/hash.py
+++ b/hash.py
@@ -12,7 +12,9 @@ def intify(hstr):
 def stringify(int):
     str = hex(int)[2:]
     if str[-1] == 'L':
-       str = str[:1]
+       str = str[:-1]
+    if len(str) % 2 != 0:
+       str = '0' + str
     str = str.decode('hex')
     return (20 - len(str)) *'\x00' + str