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

@ -12,11 +12,13 @@ ini_set("session.save_path", "/tmp");
$webuidir = "";
$verbose = 0;
$mode = "unit";
$algo = "sha256";
$opts = 'h::v';
$lopts = array(
'webui:',
'mode:',
'algo:',
'verbose'
);
@ -37,6 +39,10 @@ if ( $options = getopt( $opts, $lopts ) )
$mode = $options['mode'];
}
if ( isset($options['algo']) ) {
$algo = $options['algo'];
}
if ( isset($options['h']) )
{
display_help();
@ -66,6 +72,7 @@ Registry::set('db', $db);
Registry::set('DB_DRIVER', DB_DRIVER);
define('MODE', $mode);
define('ALGO', $algo);
$data = get_hash_values();
@ -143,7 +150,7 @@ function get_hash_values() {
START_ID => $start_id,
STOP_ID => $stop_id,
COUNT => $count,
HASH_VALUE => sha1($s)
HASH_VALUE => hash(ALGO, $s)
];
}