diff options
| -rw-r--r-- | .gitignore | 3 | ||||
| -rw-r--r-- | src/db/model.rs | 5 |
2 files changed, 7 insertions, 1 deletions
@@ -6,3 +6,6 @@ Cargo.lock.orig *.db-wal *.db-shm .DS_Store + +# goal-tracker state, not project source +.pi/ diff --git a/src/db/model.rs b/src/db/model.rs index 66674ab..07065c5 100644 --- a/src/db/model.rs +++ b/src/db/model.rs @@ -58,8 +58,11 @@ impl Identity { /// The hash that makes I3 a fact: two byte-identical inputs never produce /// two candidates, and any change to what becomes a byte in the artifact /// produces a new one. + /// A digest of the canonical JSON of the identity tuple. This is the value + /// an approval must echo: two candidates share an `identity_hash` only if + /// every pin, digest and version in them is identical. pub fn hash(&self) -> String { - hash::canonical_json(self) + format!("sha256:{}", hash::hex(hash::canonical_json(self).as_bytes())) } } |
