in reply to Re^3: Calculating the crc checksum of a file using perl?
in thread Calculating the crc checksum of a file using perl?

<q>I'm curious, why do you think crc is popular? Sure, your harddrive/os/filesystem/browser... use it, but they use md5 and sha1 too</q>

Ah.. it is just cultural. SHA-1 and MD5 are more accurate but they tend to be alot slower and also less known. You can kinda think that SHA-1 and MD5 as Python and Ruby, while crc32 being Perl. You see altought Python and Ruby are getting popularity, Perl is still as twice as popular compare to them.(accoding to an usage statistic by some websites)

  • Comment on Re^4: Calculating the crc checksum of a file using perl?

Replies are listed 'Best First'.
Re^5: Calculating the crc checksum of a file using perl?
by Khen1950fx (Canon) on Jul 09, 2011 at 06:04 UTC
    I think that you might be overlooking the fact that there is more than one way to do it in Perl. You haven't found a specific module for doing crc32 because there probably isn't a need for one, considering how fast and popular crc is; instead, you'll find the crc32 functionality spread out among a large group of modules that use the crc32 function in a way that is optimized for each individual module. For example, Compress::Zlib---It's a core dual-lived module that requires just core modules. It can do crc32 as for example:
    #!/usr/bin/perl use strict; use warnings; use Compress::Zlib; my $file = '/usr/lib/somefile.txt'; print my $crc = crc32($file), "\n";

      Yes! This is the exact answer that I was looking for when I made the question. Thanks to you, Khen1950fx

      After finding out that the Digest module can't do crc32 without an extra installation from the CPAN, I thought there is a very strong chance that there is another core module that can do it, since crc is so popular and such a common thing to do.

      So, I questioned here to find out what the module that is, and I was just keep being admised to use CPAN for this until Khen1950fx come and enlighten me that Compress::Zlip can actually do it!

      Just as you see from how this thread went, Some people are way too fanatic about CPAN usage. Sure, CPAN has its own goodness, and re-inventing wheel sucks... But what's the point of borrowing a wheel from CPAN if there is already a perfect wheel siting at your core house, like the one mentioned above here? CPAN is just one of the ways, and not the only way. Hope some people understand this....

        Just as you see from how this thread went, Some people are way too fanatic about CPAN usage. Sure, CPAN has its own goodness, and re-inventing wheel sucks...

        You should lookup fanatic in the dictionary.

        You should follow up when you get an answer Re^3: Calculating the crc checksum of a file using perl?

        But what's the point of borrowing a wheel from CPAN if there is already a perfect wheel siting at your core house, like the one mentioned above here?

        Well, if you can't find the wheel in your core house yourself (grep -ri crc32 ....lib... ), get the one you can find, even if its on CPAN or made of hotdogs