Modifier and Type | Method and Description |
---|---|
static SecureRandomStringUtils |
getInstance() |
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. |
String |
randomString(int length,
char[] alphabet)
Generates a random
String by randomly selecting characters from
the provided alphabet until the desired length is reached. |
public static SecureRandomStringUtils getInstance()
SecureRandomStringUtils
.public 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.
public 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[])
Copyright © 2020 Atlassian. All rights reserved.