Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: How to make a fingerprint from an Object

by doom (Deacon)
on May 08, 2007 at 00:03 UTC ( [id://614074]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-19 18:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found