I'm doing some CF R&D (basically I have a little free time, and I was thinking about playing with some things) – and I needed a hash code that would be specific to an object- more often than not a complex object like a Struct or Array.
I finally came along to java.lang.System.identityHashCode() which gives you a specific number that is unique to that object. It is important to note that if the object changes (i.e. you append a value to the array for example) the value of identityHashCode stays the same.
So if you were to compare two
identiyHashCodes from different objects, if they were the same, you know them to be exactly the same object.
So of course, i came up with a little UDF for this:
EDIT :::: made a small mistake when I first wrote this UDF as I was walking out the door… fixing it now.
var system = createObject("java", "java.lang.System");
Nothing very exciting in the UDF, but an interesting piece of code never the less, if you are trying to muck around with some of the inner workings of Objects in CF.