Hi..
I'd like to compare some large objects representing trees and cache something to avoid comparing each time the new object with one already existing...
The question is what would be the best something ? (a compromise between performance and collisions...).
On the one hand, I have a regular hashCode function based on the value of various fields (following the chapter 3 of effective Java. But I'm not able to evaluate the potential collisions entailed by such an approach.
On the other hand, I have the MessageDigest approach from the standard java distribution with SHA-1 algorithm. I presume it's not going to be efficient but I may have less collision. Am I right ? Is it a correct solution in my context or am I completely wrong ?
The thing is that I don't know what would be the size of the objects. Please also note that the value computed is not going to be used in a HashTable.
thx...