Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Is UUID in java absolutely unique?

  1. #1
    Junior Member
    Join Date
    Jun 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Is UUID in java absolutely unique?

    Hello, everyone.

    I've got a need to generate a distributed unique id for every object that'll be transmitted in my distributed system. Can UUID be used under this circumstance?


  2. #2
    Member mjr's Avatar
    Join Date
    Jan 2012
    Location
    127.0.0.1
    Posts
    39
    My Mood
    Fine
    Thanks
    9
    Thanked 2 Times in 1 Post

    Default Re: Is UUID in java absolutely unique?

    This should answer your question about UUID in your title.

    Universally unique identifier - Wikipedia, the free encyclopedia

    There are 340,282,366,920,938,463,463,374,607,431,768,211,45 6 possible UUIDs (16 to the 32nd power), or about 3 10^38. Or 340 undecillion.

    So the odds of you getting a duplicate copy, as you can see, are very infinitesimal.

    Another way of looking at it is this way:

    If you want to assign UUIDs to your objects, let's say you have seven billion objects. You would be able to assign over 48,611,766,702,991,100,000,000,000,000 UUIDs (That's 48 octillion) to each object. If my math is right.
    Last edited by mjr; June 29th, 2012 at 07:26 AM.

Similar Threads

  1. What unique/innovative game ideas did you like?
    By keysle in forum Totally Off Topic
    Replies: 0
    Last Post: May 25th, 2012, 11:56 PM
  2. unique identifier
    By jack_nutt in forum Java Theory & Questions
    Replies: 25
    Last Post: June 20th, 2011, 07:27 AM
  3. Problem with automatically creating new objects with unique names
    By oniamien in forum Java Theory & Questions
    Replies: 2
    Last Post: December 4th, 2010, 02:38 PM