summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2002-04-17 21:50:03 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2002-04-17 21:50:03 (GMT)
commit343cbd02792190e6926acdeb965163e9f22bb8cc (patch)
tree0f74ef49c07cdb5765c289398ceb2ac7ccd39466 /Tools
parent2ee4be077534577eed52c136d10d9f8c0731e864 (diff)
downloadcpython-343cbd02792190e6926acdeb965163e9f22bb8cc.zip
cpython-343cbd02792190e6926acdeb965163e9f22bb8cc.tar.gz
cpython-343cbd02792190e6926acdeb965163e9f22bb8cc.tar.bz2
Use 2.1's .hexdigest() method
Diffstat (limited to 'Tools')
-rw-r--r--Tools/scripts/md5sum.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/Tools/scripts/md5sum.py b/Tools/scripts/md5sum.py
index ac2eac0..1bacdf2 100644
--- a/Tools/scripts/md5sum.py
+++ b/Tools/scripts/md5sum.py
@@ -2,16 +2,13 @@
"""Python utility to print MD5 checksums of argument files.
-Works with Python 1.5.2 and later.
+Works with Python 2.1 and later.
"""
import sys, md5
BLOCKSIZE = 1024*1024
-def hexify(s):
- return ("%02x"*len(s)) % tuple(map(ord, s))
-
def main():
args = sys.argv[1:]
if not args:
@@ -26,7 +23,7 @@ def main():
break
sum.update(block)
f.close()
- print hexify(sum.digest()), file
+ print sum.hexdigest(), file
if __name__ == "__main__":
main()