I was wondering what the easiest way to convert a UUID to a unique integer would be? I have tried using the hash code but people tell me that it is not going to always be un
A UUID is a 16-Byte number (128 bit). You can't crunch it into an int (32 bit) while preserving it's uniqueness.
Mathematically spoken: 296 UUIDs will share the same Java-int-size hash value (which is ... a lot ;) )
A way out - some real life UUID often have a rather static part. So in isolated scenarios, the real unique portion of UUIDs may be less then 32 bit.