Package dev.demeng.pluginbase.random
Class RandomString
java.lang.Object
dev.demeng.pluginbase.random.RandomString
Utility for generating random strings with customizable length.
WARNING: IDs generated with this utility are NOT guaranteed to be random, though the chance of getting a duplicate ID becomes increasingly unlikely as you increase the length.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final char[]static final char[]static final char[]static final char[]static final char[]static final char[] -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
ALPHABET_UPPER
public static final char[] ALPHABET_UPPER -
ALPHABET_LOWER
public static final char[] ALPHABET_LOWER -
NUMBERS
public static final char[] NUMBERS -
ALPHANUMERIC_UPPER
public static final char[] ALPHANUMERIC_UPPER -
ALPHANUMERIC_LOWER
public static final char[] ALPHANUMERIC_LOWER -
ALPHANUMERIC_MIXED
public static final char[] ALPHANUMERIC_MIXED
-
-
Constructor Details
-
RandomString
public RandomString()
-
-
Method Details
-
generate
Generates a new "unique" string identifier with the specified length.- Parameters:
length- The length of the ID- Returns:
- The generated ID
-