Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6970697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:44:36+00:00 2026-05-27T16:44:36+00:00

In java, we have UUID (Universally unique identifier) for generating unique IDs. I am

  • 0

In java, we have UUID (Universally unique identifier) for generating unique IDs.
I am using this to get unique identifiers.

So, I am getting an unique identifier as: 35ffa200-aaa5-40ec-ab6f-20bb36632f86 (5 groups separated by hyphens).

I dont need such lengthy identifiers. My identifier must be of short value, say the code must be of only 3 groups. How can I get such small unique identifiers. Is there any limits in UUID class? I am afraid to use string limits for UUID. Is it a correct way

or is there any way to generate such small unique identifiers?

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T16:44:36+00:00Added an answer on May 27, 2026 at 4:44 pm

    UUID stands for Universally Unique IDentifier. Most of the bits of a typical UUID are dedicated to the problem of making the identifiers universally unique, both in time and in the “space” of the internet. In fact there are a number of different UUID formats that address this problem in different ways, but they all depend on having a lot of bits (~128) for the UU characteristics. The Wikipedia page on UUIDs gives more details and has links to relevant standards and specifications.

    You seem to be asking if you can use a substring of a UUID. The answer is that if you do this you will probably end up with an identifier that doesn’t have strong enough guarantees of uniqueness.

    If you want to generate identifiers for private purposes, they probably don’t need to be universally unique. Your identifiers’ uniqueness requirements (and other characteristics) will depend on the use to which you intend to put them, and without you telling us what they are, it is hard to suggest an appropriate solution. But here are some examples:

    • For simple cases, a timestamp or some other monotonically increasing integer sequence will be sufficient.
    • If you want weak or stronger non-guessability you could use some kind of random or pseudo-random number generator.
    • If you need to generate these numbers at multiple places, either incorporate the location into the id, or split the id-space into subspaces in some way.

    It is also necessary to do your sums on the likely rate of identifier generation / use, and consider what happens when your id generator runs out. (Is wrap-around acceptable? Can you reclaim and reissue ids that are no longer used? Does your chosen id representation allow you to expand / extend the id space?)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have run into an exasperating problem getting a Java service client to communicate
Does Java have a using statement that can be used when opening a session
I have an object that was stored via mongo-java-driver. Object uses java.util.UUID for its
I need to create a UUID or GUID in java 1.4. I get a
I have a table like this in sybase uuid | varchar parent_uuid | varchar
Hi all I have created server and client using blackberry java programming ,but i
So i have this new Axis2 MTOM Webservice serving correctly to a java based
Does Java have a built-in way to escape arbitrary text so that it can
Does Java have a data type that represents a period of time eg 34
Does Java have buffer overflows? If yes can you give me scenarios?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.