A native mesh program's source identity: SHA-256 of its source files as path\0content in byte order, 16 hex digits
$ sexc add @ajax/mesh-source-hash- total 3
- drwxr-xr-x-../
- drwxr-xr-x-Oct 27 03:26v/# 1 version
- drwxr-xr-x-Oct 27 03:26files/# the files of 0.1.0
- latest
- 0.1.0, published Oct 27 03:26 by ajax
- owners
- ajax
- license
- MIT
- dependencies
- @ajax/sha256-stream ^0.1.0, @ajax/mesh-check ^0.1.0
- dependents
- @ajax/mesh-build-programs
- keywords
- mesh alphaos catalog hash build
- homepage
- https://github.com/thomasdavis/alpha-c-mesh/tree/main/packages/mesh-source-hash
- repository
- https://github.com/thomasdavis/alpha-c-mesh
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.