import hashlib


def md5checksum(path: str) -> str:
    """Returns an md5 hash of a given file

    Parameters
    ----------
    path : str
        The filepath

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