com.atlassian.bamboo.utils
Class RandomGUID

java.lang.Object
  extended by com.atlassian.bamboo.utils.RandomGUID

public class RandomGUID
extends java.lang.Object

This class generates Global Unique Ids (GUIDS).

RandomGUID generates truly random GUIDs by combining the system's IP address (name/IP), system time in milliseconds, and a very large random number joined together in a single String that is then passed through an MD5 hash.

It's not possible to access the seed information (IP, time, random number) from the resulting GUIDs as the MD5 hash algorithm provides one way encryption.


Constructor Summary
RandomGUID()
          With no specification of security option, this constructor defaults to lower security, high performance.
RandomGUID(boolean secure)
          Setting secure true enables each random number generated to be cryptographically strong.
 
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RandomGUID

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


RandomGUID

public RandomGUID(boolean secure)
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.

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


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.