org.objectweb.carol.cmi
Class SecureRandom

java.lang.Object
  extended byorg.objectweb.carol.cmi.SecureRandom

public class SecureRandom
extends java.lang.Object

Wrapper for java.security.SecureRandom

Author:
Simon Nieuviarts
See Also:
SecureRandom

Method Summary
static int getInt()
          Get a random number
static int getInt(int n)
          Returns a random number between 0 (inclusive) and the specified value (exclusive).
static long getLong()
          Get a random number
static void setSeed(byte[] rs)
          Reseeds the underlying random object
static void setSeed(long rs)
          Reseeds the underlying random object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setSeed

public static void setSeed(long rs)
Reseeds the underlying random object

Parameters:
rs - the seed

setSeed

public static void setSeed(byte[] rs)
Reseeds the underlying random object

Parameters:
rs - the seed

getInt

public static int getInt()
Get a random number

Returns:
the next pseudorandom (int value)

getInt

public static int getInt(int n)
Returns a random number between 0 (inclusive) and the specified value (exclusive).

Parameters:
n - the bound on the random number. Must be positive.
Returns:
the random number (int value)

getLong

public static long getLong()
Get a random number

Returns:
the next pseudorandom (long value)