Skip to content

Commit

Permalink
feat: add sorting and to lower for checksum
Browse files Browse the repository at this point in the history
  • Loading branch information
Karol-Stelmaczonek committed Apr 11, 2024
1 parent 129d4bc commit aacccee
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions models/classes/metadata/ChecksumGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

namespace oat\taoQtiTest\models\classes\metadata;

use common_Logger;
use core_kernel_classes_Property as Property;
use oat\generis\model\data\Ontology;

Expand All @@ -45,11 +46,11 @@ public function getRangeChecksum(Property $property): string
if (empty($listValues)) {
return '';
}

asort($listValues);
foreach ($listValues as $value) {
$checksum .= $this->ontology->getResource($value['id'])->getLabel();
$checksum .= strtolower($this->ontology->getResource($value['id'])->getLabel());
}

return sha1($checksum);
common_Logger::e(sprintf('ChecksumGenerator value before sha1 : "%s"', $checksum));
return sha1(trim($checksum));
}
}

0 comments on commit aacccee

Please sign in to comment.