#!/usr/bin/python import md5, base64, sys, os for name in sys.argv[1:]: file = open(name,"rb") hasher = md5.md5() length = 0 while 1: block = file.read(1024) if not block: break hasher.update(block) length += len(block) file.close() if length < 10000: # Not worth the effort continue print "" print " Header add Content-MD5:", base64.encodestring(hasher.digest()).strip() print ""