in reply to How to make a fingerprint from an Object

You don't make it entirely clear what you mean by a "duplicate" object. If you're interested in finding objects with identical data, then yes, an MD5 fingerprint (updated whenever the data was last changed) would be a decent solution. If you're looking for copies of the same object, then you can just check scalar $object.

  • Comment on Re: How to make a fingerprint from an Object

Replies are listed 'Best First'.
Re^2: How to make a fingerprint from an Object
by Dervish (Friar) on May 08, 2007 at 03:35 UTC
    Of course, you might want to do a bit more data analysis before you just jump into using a hash, since the process of creating the hash will, by definition, take longer than it would to simply examine the two structures once. So whether or not the hash will speed up your code depends on what you want to do with it.

    That said, MD5 is a good hashing algorithm. The number of false collisions is small, the algorithm itself is fairly simple (and fast) and if your structure is significantly bigger than the hash key size, the process of comparing many hash keys might be a lot faster than that of comparing many structures. We use it where I work to shortcut the parsing of some multi-megabyte structures, if the user asks to include them many times.