code: def get_file_hexdigest(filename, blocksize=1024*1024*10):
      '''Get a hex digest of a file.'''
  
      if hashlib.__name__ == 'hashlib':
          m = hashlib.md5()       # new - 'hashlib' module
      else:
          m = hashlib.new()       # old - 'md5' module - remove once py2.4 gone
      fd = open(filename, 'r')
  
      while True:
          data = fd.read(blocksize)
          if len(data) == 0:
              break
          m.update(data)
  
      fd.close()
      return m.hexdigest(f get_file_hexdigest(filename, blocksize=1024*1024*10):
      '''Get a hex digest of a file.'''
  
      if hashlib.__name__ == 'hashlib':
          m = hashlib.md5()       # new - 'hashlib' module
      else:
          m = hashlib.new()       # old - 'md5' module - remove once py2.4 gone
      fd = open(filename, 'r')
  
      while True:
          data = fd.read(blocksize)
          if len(data) == 0:
              break
          m.update(data)
  
      fd.close()
      return m.hexdigest()
docs: Get a hex digest of a file.