Skip to content

basalt / audit/src / computeAuditHashV2

Function: computeAuditHashV2() ​

> computeAuditHashV2(entry, signer?): string

Defined in: audit/src/chain.ts:179

The v2 hash of entry given its prevHash (genesis when absent) — what Audit writes. Without signer: v2:sha256:<hex>. With one: v2:hmac-sha256:<signer.id>:<hex>, the HMAC under signer.key (then a database writer without the key cannot recompute a self-consistent chain). The algorithm and key id are both in the string and in the digested canonical form, so a verifier holding several keys knows which one to use, and nobody can relabel an entry to another key.

Parameters ​

entry ​

AuditEntry

signer? ​

AuditSigningKey

Returns ​

string

Released under the MIT License.