Function re_build_tools::compute_dir_hash

source ·
pub fn compute_dir_hash<'a>(
    path: impl AsRef<Path>,
    extensions: Option<&'a [&'a str]>,
) -> String
Expand description

Given a directory path, computes the sha256 hash of the accumulated contents of all of its files (ordered by filename), and returns an hexadecimal string for it.

This includes files in sub-directories (i.e. it’s recursive).

This will automatically emit a rerun-if-changed clause for all the files that were hashed.

If extensions is specified, only files with the right extensions will be iterated. Specified extensions should not include the leading dot, e.g. fbs rather than .fbs.