current/utils create-package-feed.pl,1.6,1.7

Fabian Keil <[email protected]> Sat, 16 Jul 2016 11:43:04 +0000
Newsgroups gmane.comp.web.privoxy.cvs
Message-ID <[email protected]>
Update of /cvsroot/ijbswa/current/utils
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv32631/utils

Modified Files:
	create-package-feed.pl 
Log Message:
create-package-feed.pl: Use SHA-256 instead of SHA-1


Index: create-package-feed.pl
===================================================================
RCS file: /cvsroot/ijbswa/current/utils/create-package-feed.pl,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** create-package-feed.pl	16 Jul 2016 11:42:51 -0000	1.6
--- create-package-feed.pl	16 Jul 2016 11:43:02 -0000	1.7
***************
*** 3,7 ****
  use warnings;
  use strict;
! use Digest::SHA1;
  my @months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
  my @days   = qw(Sun Mon Tue Wed Thu Fri Sat Sun);
--- 3,7 ----
  use warnings;
  use strict;
! use Digest::SHA;
  my @months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
  my @days   = qw(Sun Mon Tue Wed Thu Fri Sat Sun);
***************
*** 28,32 ****
  my $isdst;
  my $target;
! my $target_sha1;
  my $target_uri;
  my $target_time;
--- 28,32 ----
  my $isdst;
  my $target;
! my $target_sha256;
  my $target_uri;
  my $target_time;
***************
*** 54,65 ****
              next if (!-e $target);    # skip if file is not exist
  
!             # Get SHA-1 hash
              my $filedata;
              open($filedata, "<", $target)
                  or die "Can't open '$target' to generate checksum $!";
!             my $sha1 = Digest::SHA1->new;
!             $sha1->addfile($filedata);
              close($filedata);
!             $target_sha1 = $sha1->hexdigest;
  
              # URI and Time
--- 54,65 ----
              next if (!-e $target);    # skip if file is not exist
  
!             # Get SHA-256 hash
              my $filedata;
              open($filedata, "<", $target)
                  or die "Can't open '$target' to generate checksum $!";
!             my $sha256 = Digest::SHA->new("SHA-256");
!             $sha256->addfile($filedata);
              close($filedata);
!             $target_sha256 = $sha256->hexdigest;
  
              # URI and Time
***************
*** 73,78 ****
                    '<description><![CDATA['
                  . $target_uri
!                 . ' (SHA-1: '
!                 . $target_sha1
                  . ')]]></description>';
              $target_line .=
--- 73,78 ----
                    '<description><![CDATA['
                  . $target_uri
!                 . ' (SHA-256: '
!                 . $target_sha256
                  . ')]]></description>';
              $target_line .=


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev