diff options
Diffstat (limited to 'Lib/test/test_md5.py')
-rw-r--r-- | Lib/test/test_md5.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/test/test_md5.py b/Lib/test/test_md5.py index 5e453fa..e2d3f22 100644 --- a/Lib/test/test_md5.py +++ b/Lib/test/test_md5.py @@ -4,15 +4,15 @@ import string from md5 import md5 def hexstr(s): - h = string.hexdigits - r = '' - for c in s: - i = ord(c) - r = r + h[(i >> 4) & 0xF] + h[i & 0xF] - return r + h = string.hexdigits + r = '' + for c in s: + i = ord(c) + r = r + h[(i >> 4) & 0xF] + h[i & 0xF] + return r def md5test(s): - return 'MD5 ("' + s + '") = ' + hexstr(md5(s).digest()) + return 'MD5 ("' + s + '") = ' + hexstr(md5(s).digest()) print 'MD5 test suite:' print md5test('') @@ -27,4 +27,4 @@ print md5test('12345678901234567890123456789012345678901234567890123456789012345 m = md5('testing the hexdigest method') h = m.hexdigest() if hexstr(m.digest()) <> h: - print 'hexdigest() failed' + print 'hexdigest() failed' |