Skip to content

Cryptographic checksum

Reference

Election->getChecksum() More cryptographics infos on the method reference page

Powerful method to check the integrity after a wakeup action from serialized election or detect some changes (new votes, new computing data...) quickly between two states.

php
<?php

use CondorcetPHP\Condorcet\Election;

$election = new Election;
$originalChecksum = $election->getChecksum();
$toStore = serialize($election);
unset($election);
$newElection = unserialize($toStore);

expect($originalChecksum)->toBe($newElection->getChecksum());

Released under the MIT License.