$ md5 test.py MD5 (test.py) = 04523172fa400cb2d45652d818103ac3 $ python Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import hashlib >>> s = open('test.py','rb').read() >>> hashlib.md5(s).hexdigest() '04523172fa400cb2d45652d818103ac3'
source share