aspose file tools*
The moose likes Java in General and the fly likes Unique Key Generation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Unique Key Generation" Watch "Unique Key Generation" New topic
Author

Unique Key Generation

Saidul Islam
Greenhorn

Joined: Dec 05, 2000
Posts: 18
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>

<b>JStar</b><BR>
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Sounds like a good question for this forum.
This is another thread that was discussing random number generation: http://www.javaranch.com/ubb/Forum33/HTML/001523.html


"JavaRanch, where the deer and the Certified play" - David O'Meara
Steve Fahlbusch
Bartender

Joined: Sep 18, 2000
Posts: 570
    
    7

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unique Key Generation