Class RandomStringFromAlphabetGenerator
- java.lang.Object
-
- org.schabi.newpipe.extractor.utils.RandomStringFromAlphabetGenerator
-
public final class RandomStringFromAlphabetGenerator extends java.lang.Object
Generates a random string from a predefined alphabet.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
generate(java.lang.String alphabet, int length, java.util.Random random)
Generate a random string from an alphabet.
-
-
-
Method Detail
-
generate
@Nonnull public static java.lang.String generate(java.lang.String alphabet, int length, java.util.Random random)
Generate a random string from an alphabet.- Parameters:
alphabet
- the characters' alphabet to uselength
- the length of the returned string (greater than 0)random
-Random
(or betterSecureRandom
) used for generating the random string- Returns:
- a random string of the requested length made of only characters from the provided alphabet
-
-