Hashing

sealed interface Hashing

Hashing strategy for journal entries — controls whether AppendedEntry.entryHash is populated.

Using a sealed interface ensures that any attempt to reference a non-existent variant fails at compile time, not at runtime. Executor gates use an exhaustive when over this interface so that a future variant (e.g. Sha256V2) cannot silently slip past without being handled.

See also

ca.acendas.kstate.saga.journal.F005

-canonical-bytes for the canonical-bytes format spec locked at GA (spec/references/F005-canonical-bytes.md).

Inheritors

Types

Link copied to clipboard
data object None : Hashing

No hashing. AppendedEntry.entryHash is always null. This is the default and the only mode that does not compute canonical bytes. Use this when tamper-evidence is not required (the common case).

Link copied to clipboard
data object Sha256 : Hashing

SHA-256 hash-chain mode. Each AppendedEntry.entryHash is a 64-character lowercase hex string equal to SHA-256 over the entry's canonical bytes. Non-genesis entries link to the prior entry's hash via prevHash, forming a tamper-evident append-only chain.