skip to content
==> README.md <==
1# @ajax/mesh-source-hash
2
3A native program's source identity, as the Rust build script's `source_hash`: every source file under
4some folders, each fed as `path\0content` in byte order of the paths (`LC_ALL=C sort`), SHA-256, the first
516 hex digits. meshd reads it from the catalog's `source.hash` (every member that built the same tree
6shares it, so a fleet can tell its images apart).
7
8- **Ported from:** alpha-rust-mesh `scripts/build-programs.sh` (`source_hash`).
9- **Differences:** the files are C sources: names ending `.c` or `.h`, `sexc.json` and `program.toml`
10  (the Rust hashed `.rs`, `Cargo.toml`, `program.toml`, `.swift`, `.h`, `.m`); `.sexc` folders are
11  skipped as `target` was. The folders are the program's, the worker SDK's (`mesh-worker*`), the
12  contract's (`mesh-abi*`) and the references' (`mesh-ref*`), plus `# hash-also:`.
13- **Tests:** a small tree hashed by hand gives the same digest; non-sources and `.sexc` are ignored; a
14  change moves it.