Leandro Lameiro <[EMAIL PROTECTED]> writes: > What's wrong in having a function like the one I said, that would > split files for you, feed md5.update and, when it is over, return the > digest?
Nothing in particular; it's just a trivial thing to write. If you add every usefull utility function to the standard library, you wind up with a multi-thousand page library documentation. The line has to be drawn somewhere. > It is easier, doesn't require MD5 objects creation, works well on > small and big files, makes the code more readable and simple. Also, > calculating MD5 of files seems to be a common enough task to be put in > the library (well, at least on GNU/Linux we have one command just for > this - md5sum) Wanting to sum a file at the command line isn't that uncommon, so a utility makes some sense. But how often does a program need the md5 sum of a file? Especially compared to how often it wants to take the md5 sum of some string that isn't in a file? It might be worth adding. Except that md5 isn't really trusted anymore; you really want to be using sha1 (and you presumably have an sha1sum utility. FreeBSD has md5 and sha1 commands). But the sha module doesn't have a file handler either. You might try posting a patch to sourceforge, and see if it gets accepted. <mike -- Mike Meyer <[EMAIL PROTECTED]> http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. -- http://mail.python.org/mailman/listinfo/python-list