mirror of
https://bitbucket.org/jsuto/piler.git
synced 2025-06-13 07:27:03 +02:00
Updated timestamp algorithm to use sha256
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
@ -463,7 +463,7 @@ create table if not exists `timestamp` (
|
||||
`id` bigint unsigned not null auto_increment,
|
||||
`start_id` bigint default 0,
|
||||
`stop_id` bigint default 0,
|
||||
`hash_value` char(40),
|
||||
`hash_value` varchar(128),
|
||||
`count` int default 0,
|
||||
`response_time` bigint default 0,
|
||||
`response_string` blob not null,
|
||||
|
1
util/db-upgrade.sql
Normal file
1
util/db-upgrade.sql
Normal file
@ -0,0 +1 @@
|
||||
alter table timestamp change column hash_value hash_value varchar(128) default null;
|
@ -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)
|
||||
];
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user