def GetFileMd5(filename): if not os.path.isfile(filename): return myhash = hashlib.md5() f = file(filename,‘rb‘) while True: b = f.read(8096) if not b : break myhash.update(b) f.close() return myhash.hexdigest()
时间: 2024-10-22 18:15:26
def GetFileMd5(filename): if not os.path.isfile(filename): return myhash = hashlib.md5() f = file(filename,‘rb‘) while True: b = f.read(8096) if not b : break myhash.update(b) f.close() return myhash.hexdigest()