|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.crowd.util.SecureRandomStringUtils
public class SecureRandomStringUtils
Generates random Strings by selecting characters from
an alphabet using a cryptographically secure PRNG.
Methods on this class are thread-safe.
| Method Summary | |
|---|---|
static SecureRandomStringUtils |
getInstance()
|
java.lang.String |
randomAlphanumericString(int length)
Generates a random String by randomly selecting characters from the the
alphabet of characters in the range 0-9, A-Z and a-z. |
java.lang.String |
randomString(int length,
char[] alphabet)
Generates a random String by randomly selecting characters from
the provided alphabet until the desired length is reached. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static SecureRandomStringUtils getInstance()
SecureRandomStringUtils.
public java.lang.String randomString(int length,
char[] alphabet)
String by randomly selecting characters from
the provided alphabet until the desired length is reached.
The method for selecting a random character is specified by the implementation.
Unicode surrogate-pairing is not supported. All the provided characters should be
in the Unicode BMP, if you wish to avoid generating Strings with invalid UTF-16
surrogates.
length - desired length of random String. Must be positive.alphabet - collection of characters to select from. Must contain at least one character.
String of length length, composed of characters from the supplied alphabet.public java.lang.String randomAlphanumericString(int length)
String by randomly selecting characters from the the
alphabet of characters in the range 0-9, A-Z and a-z.
The method for selecting a random character is specified by the implementation.
length - desired length of random String.
String of length length.randomString(int, char[])
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||