import hashlib


def get_md5(filename: str) -> str:
    """Calculates the MD5 sum of the passed file

    Args:
        filename: File to hash
    Returns:
        str: MD5 hash of file
    """

    # Size of buffer in bytes
    BUF_SIZE = 65536
    md5 = hashlib.md5()

    # Read the file in 64 kB blocks
    with open(filename, "rb") as f:
        while True:
            data = f.read(BUF_SIZE)
            if not data:
                break
            md5.update(data)

    return md5.hexdigest()