Rafal Krzewski wrote:
> 
> Hi all.
> 
>         I wrote some code to assign an unique identifier to the running Turbine 
>instance.
> It can be used for prefixing names of files in common temporary directory on a 
>server,
> or to identify user's preferences for this particular Turbine application on an LDAP
> sever and possibly many other purproses.
> 
>         My idea for generating an unique id was taking full servlet URL (schema,
> host, port, context & servlet name) and calculating an MD5 digest of it. The input
> data is unique both on the server and on the network where the application is visible
> from. Of course there's still 1:2^128 probability that there will be an id clash, but
> it's a nincredibly small chance, and the resulting ids are well defined, one-way and
> pretty.

+1 on your patch Rafal.  There's another way of generating such unique
IDs, which involves the host IP and MAC address (they're XOR'd or
bitwise AND'd or something), which may be cheaper.  I don't know how to
implement this easily from Java code, however.  Just an FYI.  =)
-- 

Daniel Rall <[EMAIL PROTECTED]>


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to