KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I usually use the UUID class to generate unique IDs. This works fine if these IDs are used by technical systems only, they don't care how long they are: System.out.println(UUID.randomUUID().toString()); > 67849f28-c0af-46c7-8421-94f0642e5d4d Is there a nice way to create user friendly unique IDs (like those from tinyurl) which are a bit shorter than the UUIDs? Usecase: you want to send out IDs via Mail to your customers which in turn visit your site and enter that number into a form, like a voucher ID. I assume that UUIDs get generated equally through the whole range of the 128 Bit range of the UUID. So would it be sage to use just the lower 64 Bits for instance? System.out.println(UUID.randomUUID().getLeastSignificantBits()); Any feedback is welcome.
Tags (comma-separated)
Save Edits
Cancel