org.gridbus.broker.util
Class RandomGUID

java.lang.Object
  extended by org.gridbus.broker.util.RandomGUID

public class RandomGUID
extends java.lang.Object

RandomGUID generates truly random GUIDs by using the system's IP address (name/IP), system time in milliseconds (as an integer), and a very large random number joined together in a single String that is passed through an MD5 hash. The IP address and system time make the MD5 seed globally unique and the random number guarantees that the generated GUIDs will have no discernable pattern and cannot be guessed given any number of previously generated GUIDs. It is generally not possible to access the seed information (IP, time, random number) from the resulting GUIDs as the MD5 hash algorithm provides one way encryption. This code is contributed by Marc A. Mnich

Author:
Marc A. Mnich

Constructor Summary
RandomGUID()
          Default constructor.
RandomGUID(boolean secure)
          Constructor with security option.
 
Method Summary
 java.lang.String toString()
          Convert to the standard format for GUID (Useful for SQL Server UniqueIdentifiers, etc.) Example: C2FEEEAC-CFCD-11D1-8B05-00600806D9B6
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RandomGUID

public RandomGUID()
Default constructor. With no specification of security option, this constructor defaults to lower security, high performance.


RandomGUID

public RandomGUID(boolean secure)
Constructor with security option. Setting secure true enables each random number generated to be cryptographically strong. Secure false defaults to the standard Random function seeded with a single cryptographically strong random number.

Parameters:
secure -
Method Detail

toString

public java.lang.String toString()
Convert to the standard format for GUID (Useful for SQL Server UniqueIdentifiers, etc.) Example: C2FEEEAC-CFCD-11D1-8B05-00600806D9B6

Overrides:
toString in class java.lang.Object
Returns: