摘要: 代码如下: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 阅读全文
posted @ 2011-03-17 13:20 iTech 阅读(2699) 评论(0) 推荐(0) 编辑