Switched to "YYYYMMDD-HHMM-hash", where "hash" consists of 8 hex
digits obtained by hashing the current time, PID and a sequence number.
-# (c) 2011-2013 Martin Mares <mj@ucw.cz>
+# (c) 2011-2015 Martin Mares <mj@ucw.cz>
use strict;
use warnings;
use strict;
use warnings;
package BEX::Job;
use POSIX ();
package BEX::Job;
use POSIX ();
$job->{'ID'} = $id;
} else {
$job_cnt++;
$job->{'ID'} = $id;
} else {
$job_cnt++;
- $job->{'ID'} = POSIX::strftime("%Y%m%d-%H%M%S-$$-$job_cnt", localtime);
+ my $dt = POSIX::strftime("%Y%m%d-%H%M%S", localtime);
+ my $hash = Digest::SHA::sha1_hex(join(":", $dt, $$, $job_cnt));
+ $job->{'ID'} = $dt . '-' . substr($hash, 0, 8);
}
$job->{'Subject'} = '';
return $job;
}
$job->{'Subject'} = '';
return $job;