[Python-checkins] python/dist/src/Tools/scripts md5sum.py,1.1,1.2
akuchling@sourceforge.net
akuchling@sourceforge.net
Wed, 17 Apr 2002 14:50:06 -0700
Update of /cvsroot/python/python/dist/src/Tools/scripts
In directory usw-pr-cvs1:/tmp/cvs-serv21415
Modified Files:
md5sum.py
Log Message:
Use 2.1's .hexdigest() method
Index: md5sum.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/scripts/md5sum.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** md5sum.py 22 Jun 2001 16:05:48 -0000 1.1
--- md5sum.py 17 Apr 2002 21:50:03 -0000 1.2
***************
*** 3,7 ****
"""Python utility to print MD5 checksums of argument files.
! Works with Python 1.5.2 and later.
"""
--- 3,7 ----
"""Python utility to print MD5 checksums of argument files.
! Works with Python 2.1 and later.
"""
***************
*** 10,16 ****
BLOCKSIZE = 1024*1024
- def hexify(s):
- return ("%02x"*len(s)) % tuple(map(ord, s))
-
def main():
args = sys.argv[1:]
--- 10,13 ----
***************
*** 27,31 ****
sum.update(block)
f.close()
! print hexify(sum.digest()), file
if __name__ == "__main__":
--- 24,28 ----
sum.update(block)
f.close()
! print sum.hexdigest(), file
if __name__ == "__main__":