1 def GetFileMd5(filename): 2 if not os.path.isfile(filename): 3 return 4 myhash = hashlib.md5() 5 with open(filename,'rb') as f: 6 while True: 7 b = f.read(8096) 8 if not b : 9 break 10 myhash.update(b) 11 return myhash.hexdigest()
每次读取一部分,进行计算,最后返回结果,怎么感觉这么low呢