# HG changeset patch # User nanaya # Date 1522658756 -32400 # Node ID 70355e17653e6267d1ac2f542c9afdfa6ec64386 # Parent 1a996b35eaabdaa1d99034cbf55df4ee3747edd4 Use zlib which is more available diff -r 1a996b35eaab -r 70355e17653e bin/cek.pl --- a/bin/cek.pl Mon Apr 02 17:44:25 2018 +0900 +++ b/bin/cek.pl Mon Apr 02 17:45:56 2018 +0900 @@ -2,7 +2,7 @@ use strict; use warnings; -use String::CRC32; +use Compress::Zlib; use File::Basename; my @files = @ARGV or print("Usage: ",basename($0)," file1 file2 ... fileN\n") && exit(1); @@ -28,8 +28,13 @@ open(FILE,"<",$filename); binmode(FILE); - $real_crc = sprintf("%08X",crc32(*FILE)); + my $file_crc = 0; + my $file_part = ''; + while (read(FILE, $file_part, 4096)) { + $file_crc = crc32($file_part, $file_crc); + } close(FILE); + $real_crc = sprintf("%08X", $file_crc); if ($name_crc) { $num_na--;