From: burris <burris>
Date: Mon, 23 Sep 2002 23:43:43 +0000 (+0000)
Subject: fix bugs in stringify
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7226de91c496d22164e7d84d552fb49f3cdc3df8;p=quix0rs-apt-p2p.git

fix bugs in stringify
---

diff --git a/hash.py b/hash.py
index 7f42f31..4210385 100644
--- 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