The events reconciliation checksum algorithm acts as a mechanism to verify that events that have been consumed by downstream consumers of Vault during a particular time window match the internal state of Vault. The algorithm used to calculate the checksum in the GetJournalEventsChecksum endpoint is described in this section.
The algorithm uses a hashing function and an XOR operation which makes its application commutative. As combining hashes using an XOR requires all of event IDs to be the same length, a preparatory processing step is required to ensure that all inputs to the XOR function for each event ID are the same length. The sha256 algorithm is used for this purpose.
The checksum is calculated using the following steps:
Hashing each event ID using the sha256 algorithm.
Applying an XOR function on each sha256 encoded hash.
Encoding the final result using the sha256 algorithm.