This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Did anyone work on any unique key generation algorithm that is not based on timestamp? Maybe based on the combnation of timestamp and random numbers, or database driven or any other mechanishm. Would you like to share your thoughts on this? Forgive me if the question sounds not related to the forum. Maybe we can ask JavaRanch host to create a new forum for discussing algorithm/pattern in Java. ------------------ <b>JStar</b>
Of the ones I have used, I ususally generate some pseudounique keys than bounce off of a file (database) of used keys and then find a appropriatily close key. This is usually some form of hashing. How it normally works: hash the key look up to see if hashed key is in use if not, mark as hashed, save object id (or whatever) if it is, look for next unused hash, mark as hashes save object id.