public class RandomString
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static char[] |
ALPHA_NUMERIC_RANGE |
protected static char[] |
ALPHA_RANGE |
protected static RandomString |
INSTANCE |
protected java.security.SecureRandom |
rnd |
Constructor and Description |
---|
RandomString()
Creates new random string.
|
Modifier and Type | Method and Description |
---|---|
static RandomString |
get()
Returns default instance of
RandomString . |
java.lang.String |
random(int count,
char[] chars)
Creates random string whose length is the number of characters specified.
|
java.lang.String |
random(int count,
char start,
char end)
Creates random string whose length is the number of characters specified.
|
java.lang.String |
random(int count,
java.lang.String chars)
Creates random string whose length is the number of characters specified.
|
java.lang.String |
randomAlpha(int count)
Creates random string of characters.
|
java.lang.String |
randomAlphaNumeric(int count)
Creates random string of characters and digits.
|
java.lang.String |
randomAscii(int count)
Creates random string whose length is the number of characters specified.
|
java.lang.String |
randomBase64(int count)
Creates random string that contains only Base64 characters.
|
java.lang.String |
randomNumeric(int count)
Creates random string that consist only of numbers.
|
java.lang.String |
randomRanges(int count,
char... ranges)
Creates random string whose length is the number of characters specified.
|
protected static final char[] ALPHA_RANGE
protected static final char[] ALPHA_NUMERIC_RANGE
protected static final RandomString INSTANCE
protected final java.security.SecureRandom rnd
public static RandomString get()
RandomString
.public java.lang.String random(int count, char[] chars)
public java.lang.String random(int count, java.lang.String chars)
public java.lang.String random(int count, char start, char end)
public java.lang.String randomAscii(int count)
32
and 126
(inclusive).public java.lang.String randomNumeric(int count)
public java.lang.String randomRanges(int count, char... ranges)
public java.lang.String randomAlpha(int count)
public java.lang.String randomAlphaNumeric(int count)
public java.lang.String randomBase64(int count)
Copyright © 2003-present Jodd Team