Documentation / @etherfold/core / processorArtifactIdentity
Function: processorArtifactIdentity() ​
processorArtifactIdentity(
bundle):string
Defined in: packages/core/src/processorArtifact.ts:62
THE IDENTITY OF SOME BYTES: sha256:<64 lowercase hex> over the bundle's octets.
The byte domain, which is the whole of the contract ​
The octets as they are, and nothing derived from them: not a decoded string, not a re-serialisation, not the base64 a loader happens to wrap them in on the way to a data: URL. It takes a Uint8Array for that reason -- a caller handing over text would have had to encode it, and two ends encoding differently is an identity that disagrees with itself.
ONE function for every runtime, which is what makes a publication usable ​
etherfold build names the fold it published with this, and a tab running the published bundle names its generation with this, over the bytes it fetched (ADR-0095). A snapshot is keyed to that name, so the two MUST agree, and the way to make them agree by construction rather than by a test is to have one definition. It is viem's synchronous SHA-256 for the reason the seed path uses it (streamSeedContentHash): it is already a dependency here, it runs in every runtime, and it does not need the secure context crypto.subtle does, so a tab served over plain HTTP on a LAN can still name what it runs.
Why the algorithm travels in front of the digits ​
This value is PASTED into builds, logs, generation records and publication indexes, where it long outlives the session that produced it, and a bare hex string cannot say which function produced it. sha256: is the prefix an OCI image digest uses, and the one streamSeedContentHash renders.
Note what it deliberately is NOT: a MINIFIED bundle is required for this to be stable across machines, because un-minified esbuild output carries a per-module path banner and therefore the building machine's directory layout. That rule belongs to the documentation of the build command; what belongs here is that this function hashes exactly what it is given and makes no attempt to normalise it.
There is deliberately NO predicate asking whether a string LOOKS like one: GenerationId.processor is compared and rendered and NOTHING parses it (ADR-0086), which is what lets a module arrival name its fold another way.
Parameters ​
bundle ​
Uint8Array
Returns ​
string