• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Unique ids
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unique ids


  • Subject: Re: Unique ids
  • From: Art Isbell <email@hidden>
  • Date: Wed, 14 May 2003 08:22:09 -1000

On Wednesday, May 14, 2003, at 12:22  AM, Georg Tuparev wrote:

I need to generate unique ids that I can also use in the url.

Currently I am using something like this:
byte [] buff = new byte[EOTemporaryGlobalID.UniqueBinaryKeyLength];
EOTemporaryGlobalID.assignGloballyUniqueBytes(buff);
String id = new String(buff);
String encodeStr = encode(id);


Well, this works, but it looks ugly as hell.

Is there a better way to produce unique strings like session ids (without creating sessions of course ;-)?

Boy I miss NSProcessInfo!

If I recall, NSProcessInfo could provide a globally unique string by concatenating the host name, process ID, and a time stamp. In a multithreaded WO app on a multiprocessor computer, it is theoretically possible that more than one session could create identical strings using this approach. EOTemporaryGlobalID uses 3 similar values plus a sequence number that should ensure uniqueness, so this should be better. But since it is comprised of similar values to those used by NSProcessInfo, is it really uglier?


Aloha,
Art
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Unique ids
      • From: Georg Tuparev <email@hidden>
References: 
 >Unique ids (From: Georg Tuparev <email@hidden>)

  • Prev by Date: Re: NSPropertyListSerialization
  • Next by Date: Re: NSPropertyListSerialization
  • Previous by thread: Unique ids
  • Next by thread: Re: Unique ids
  • Index(es):
    • Date
    • Thread