in reply to Quick and Dirty Hash

You could just use my $cksum = unpack "%32C*", $string; -- see unpack.

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart

Replies are listed 'Best First'.
Re^2: Quick and Dirty Hash
by clancey (Initiate) on Jun 22, 2006 at 02:54 UTC
    unpack does not work.

    It returns the same value for "abc def ghi" as for "acb def ghi"

    Thank you for the pointer to some more theory. I will check it out.

    Why do something myself? Firstly, curiosity. I have MD5 installed on my machine, but I wanted to try my hanbd at my own solution.

    Secondly, I am looking at something I can include in an open source project I maintain. All the users are on Windows machines and the majority struggle enormously with getting Perl installed, especially when you need extra libs.

    The problem I am trying to solve is rapidly comparing two files to see if they are the same, but where the files have randomly generated file names and creation times and where the files could be the same size as other files of the same type.
      Checksums aren't unique; eventually, you find two strings that differ but have the same checksum. Checksums are merely a precautionary measure.

      Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
      How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart