|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.norther.tammi.acorn.security.RNG
public abstract class RNG
A static random id and number generator.
Field Summary | |
---|---|
static int |
DEFAULT_LENGTH
The default length of the id. |
Constructor Summary | |
---|---|
RNG()
|
Method Summary | |
---|---|
static String |
generate()
Generates a random id of the default length. |
static String |
generate(int n)
Generates a random id of n chars. |
static SecureRandom |
getSecureRandom()
Gets the randomizer applied. |
static long |
longCount()
Returns the long count. |
static void |
nextBytes(byte[] random)
Returns the specified number of random bytes. |
static int |
nextCount()
Returns the next count. |
static int |
nextInt()
Returns a random int. |
static int |
nextInt(int n)
Returns a random int within 0 - n. |
static long |
nextLong()
Returns a random long. |
static String |
password(int n)
Generates a random password of n chars. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_LENGTH
Constructor Detail |
---|
public RNG()
Method Detail |
---|
public static final String generate()
public static final String generate(int n)
n
- the number of chars.
public static final String password(int n)
n
- the number of chars.
public static final long longCount()
public static final int nextCount()
public static final int nextInt()
public static final int nextInt(int n)
n
- the limit.
public static final long nextLong()
public static final void nextBytes(byte[] random)
random
- the byte array to fill.public static final SecureRandom getSecureRandom()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |