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.
in reply to [OT]:Faster signature algorithm than md5?
# same as "sum -s file" use System V sum algorithm, use 512 bytes bl
open (FH,"< $0");
read( FH, $buf, -s FH );
my $checksum = unpack("%32C*",$buf) %32767;