import hashlib


def caclulate_hash(path: str) -> str:
	"""Calculate md5 hash of the file in binary mode

	Args:
		path (str): Path to the file to be hashed

	Returns:
		str: The calculated hash
	"""
	hash_md5 = hashlib.md5()
	with open(path, "rb") as f:
		for chunk in iter(lambda: f.read(4096), b""):
			hash_md5.update(chunk)
	return hash_md5.hexdigest()