Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: [OT]:Faster signature algorithm than md5?

by zentara (Archbishop)
on Sep 01, 2012 at 16:06 UTC ( #991169=note: print w/replies, xml ) Need Help??

in reply to [OT]:Faster signature algorithm than md5?

For speed, you might do simple checks first, and only do an md5 check if the file size and simple crc check is identical. You can also test just the first few thousand bytes of a file, instead of running crc or md5 on the entire file.
#!/usr/bin/perl use warnings; use strict; # same as "sum -s file" use System V sum algorithm, use 512 bytes bl +ocks my $buf; open (FH,"< $0"); read( FH, $buf, -s FH ); close FH; my $checksum = unpack("%32C*",$buf) %32767; print "$checksum\n"; exit;

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://991169]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (9)
As of 2016-10-21 18:48 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (289 votes). Check out past polls.