]> code.delx.au - pymsnt/commitdiff
Small cosmeticish changes. Tests pass
authorjamesbunton <jamesbunton@55fbd22a-6204-0410-b2f0-b6c764c7e90a>
Sat, 10 Dec 2005 11:12:55 +0000 (11:12 +0000)
committerjamesbunton <jamesbunton@55fbd22a-6204-0410-b2f0-b6c764c7e90a>
Sat, 10 Dec 2005 11:12:55 +0000 (11:12 +0000)
git-svn-id: http://delx.cjb.net/svn/pymsnt/trunk@45 55fbd22a-6204-0410-b2f0-b6c764c7e90a

committer: jamesbunton <jamesbunton@55fbd22a-6204-0410-b2f0-b6c764c7e90a>

src/tlib/msn/msnp11chl.py

index 36964e58adb3043eee97d9f0d7aaf971c76cb064..258dda79baa95178580b50bb502d03948f091aa2 100644 (file)
@@ -3,7 +3,6 @@
 
 import md5
 import struct
-import string
 
 MSNP11_PRODUCT_ID = "PROD0090YUAUV{2B"
 MSNP11_PRODUCT_KEY = "YMM8C_H7KCQ2S_KL"
@@ -20,7 +19,7 @@ def doChallenge(chlData):
        # Make array of chl string ints
        chlData += MSNP11_PRODUCT_ID
        amount = 8 - len(chlData) % 8
-       chlData += string.zfill("", amount)
+       chlData += "".zfill(amount)
        chlInts = struct.unpack("<%di" % (len(chlData)/4), chlData)
 
        # Make the key
@@ -56,8 +55,8 @@ def doChallenge(chlData):
        out = ""
        for x in longs:
                x = hex(x)
-               x = x[2:len(x)-1]
-               x = x.zfill(16)
+               x = x[2:-1]
+               x = x.rjust(16)
                out += x.lower()
        
        return out