摘要:
代码如下:fromhashlibimportmd5defcalMD5(str):m=md5()m.update(str)returnm.hexdigest()defcalMD5ForFile(file):m=md5()a_file=open(file,'rb')m.update(a_file.read())a_file.close()returnm.hexdigest()defcalMD5ForFolder(dir,MD5File):importosoutfile=open(MD5File,'w')forroot,subdirs,filesinos.walk(d 阅读全文