[Yanel-dev] Unique IDs

Michael Wechner michael.wechner at wyona.com
Wed Jan 12 11:17:30 CET 2011


On 1/12/11 8:38 AM, Balz Schreier wrote:
> Dear all,
>
> Sometimes we need unique IDs, for identifying a session, a cookie or =

> other things.
>
> Usually we use the UUID class that comes with Java SE:
>
> UUID.randomUUID().toString() --> 67849f28-c0af-46c7-8421-94f0642e5d4d =

> (128 Bits)
>
> But that is very long and maybe not suitable if you require people to =

> enter that ID in a form on your web site:

what about something like

*http://tinyurl.com/49ygnbx

?

Cheers

Michael
*
>
>
> Do you have experience with other number generators?
>
> I see that UUID has also other methods, e.g.:
>
> UUID.randomUUID().getLeastSignificantBits() --> 6174657925133947722 =

> (64 Bits)
>
> UUID.randomUUID().getMostSignificantBits() --> 5706839542716611039 (64 =

> Bits)
>
>
>
> I was recently pointed to this URL where you can generated IDs by =

> configuring the length and the used characters (digits only etc.):
>
> http://www.thegeeks.us/index.php/Random_Password_Generator_Writen_In_Java
>
>
> I also posted on stackoverflow.com <http://stackoverflow.com> this =

> question:
>
> http://stackoverflow.com/questions/4666647/how-to-create-user-friendly-un=
ique-ids-uuids-or-other-unique-identifiers-in-java
>
>
> Cheers
>
> Balz
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wyona.org/pipermail/yanel-development/attachments/2011011=
2/5d19e06e/attachment-0001.htm


More information about the Yanel-development mailing list