in reply to Checksum Help
#!/usr/bin/perl use strict; use String::CRC32; my $Usage = "Usage: $0 file.name ...\n"; @ARGV or die $Usage; for my $file ( @ARGV ) { open( my $fh, "<", $file ) or die "Unable to open $file: $!\n"; my $crc = crc32( $fh ); close $fh; printf( "%08x ( %08x ) %s\n", $crc, 0xffffffff - $crc, $file ); }
I don't understand the relevance of 0xffffffff - $crc, but if it's useful at all, it helps to have fixed-width fields to the left of variable-width fields.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Checksum Help
by TeamViterbi (Novice) on Jul 07, 2009 at 22:07 UTC | |
by graff (Chancellor) on Jul 07, 2009 at 22:15 UTC | |
by TeamViterbi (Novice) on Jul 07, 2009 at 22:31 UTC | |
by TeamViterbi (Novice) on Jul 07, 2009 at 22:33 UTC | |
by graff (Chancellor) on Jul 08, 2009 at 02:25 UTC |