def write_binhash_file(
    build_dir,
    binhash_filename="constants.hash",
    filter_func: Callable[[str], bool] = is_bin_file,
):
    """Hash all binary input files, so we don't have to keep them ( Usecase: constants.obj / constants.bin )

    Args:
        build_dir (str): Path to build directory
        binhash_filename (str, optional): File to be written within build_dir, defaults to "constants.hash".
        filter_func (Callable[[str], bool], optional): Filter function to determine which files to hash. Defaults to is_bin_file.
    """
    binhash = create_dir_hash([binhash_filename], build_dir, filter_func=filter_func)
    with open(os.path.join(build_dir, binhash_filename), "w", encoding="utf-8") as f:
        f.write(binhash)
Hash all binary input files, so we don't have to keep them ( Usecase: constants.obj / constants.bin )

    Args:
        build_dir (str): Path to build directory
        binhash_filename (str, optional): File to be written within build_dir, defaults to "constants.hash".
        filter_func (Callable[[str], bool], optional): Filter function to determine which files to hash. Defaults to is_bin_file.
    
python/aitemplate/backend/build_cache_base.py