Perl: the Markov chain saw | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
You could use Digest::MD5 but that only operates on one string. In general, an object is a blessed reference to a compound data structure which doesn't automatically fit. So the real challenge is to figure out a unique way to convert the data structure to a single string that can be converted to MD5. Data::Dumper
The only thing that occurs to me though is that fingerprinting the whole object shouldn't be necessary - it should be sufficient to fingerprint an ordered, delimited concatenation of selected instance fields. It is more usual (though not necessarily mandatory) for this to be the primary key in the logical data model rather than some bulk data field. Update: You could also consider storing the MD5 in the database, setting a UNIQUE constraint on some selection of fields and letting the database deal with the problem.
__________________________________________________________________________________
^M Free your mind!
In reply to Re: How to make a fingerprint from an Object
by Moron
|
|