[Python-checkins] python/dist/src/Tools/scripts md5sum.py,1.1,1.1.18.1

anthonybaxter@sourceforge.net anthonybaxter@sourceforge.net
Wed, 17 Apr 2002 20:47:42 -0700


Update of /cvsroot/python/python/dist/src/Tools/scripts
In directory usw-pr-cvs1:/tmp/cvs-serv28406/Tools/scripts

Modified Files:
      Tag: release22-maint
	md5sum.py 
Log Message:
backport akuchling's patch:

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.1.18.1
diff -C2 -d -r1.1 -r1.1.18.1
*** md5sum.py	22 Jun 2001 16:05:48 -0000	1.1
--- md5sum.py	18 Apr 2002 03:47:40 -0000	1.1.18.1
***************
*** 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__":