import hashlib


def get_file_md5(file_name):
	"""
	Calculate the MD5 for the file
	:param file_name:
	:return:
	"""
	m = hashlib.md5()  # 创建md5对象
	with open(file_name, 'rb') as fobj:
		while True:
			data = fobj.read(4096)
			if not data:
				break
			m.update(data)  # 更新md5对象
	return m.hexdigest()