Updated timestamp algorithm to use sha256

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO
2021-12-09 11:20:18 +01:00
parent 42b650f4f1
commit 740855769f
6 changed files with 51 additions and 8 deletions

View File

@ -371,7 +371,14 @@ class ModelSearchMessage extends Model {
$s .= $q['digest'];
}
$computed_hash = sha1($s);
$len = strlen($query->row['hash_value']);
if($len == 64)
$algo='sha256';
elseif($len == 128)
$algo='sha512';
else
$algo='sha1';
$computed_hash = hash($algo, $s);
if(MEMCACHED_ENABLED) {
$memcache->add($cache_key, $computed_hash, 0, MEMCACHED_TTL);