class TokenGenerator extends java.lang.Object
Generate a string of random characters. Useful for security tokens.
Constructor and description |
---|
TokenGenerator() |
Type Params | Return Type | Name and description |
---|---|---|
|
static java.lang.String |
generate(char[] characters, int keyLength) Generates a string of characters based on a character library. |
|
static java.lang.String |
generate(CharacterLibrary library, int keyLength) Generates a string of characters based on a character library. |
|
static java.lang.String |
generate(char[] characters) Generates a 64 character string of characters based on the character library provided. |
|
static java.lang.String |
generate(CharacterLibrary library) Generates a 64 character string of characters based on the library library provided. |
|
static java.lang.String |
generateToken(int length)
|
|
static java.lang.String |
generateToken() Useful for generating auth tokens and API keys. |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Generates a string of characters based on a character library. The length of the string is dependent upon the length provided.
characters
- The character library.keyLength
- The desired length of the generated string.Generates a string of characters based on a character library. The length of the string is dependent upon the length provided.
library
- The character library.keyLength
- The desired length of the generated string.Generates a 64 character string of characters based on the character library provided.
characters
- The desired character library.Generates a 64 character string of characters based on the library library provided.
library
- The desired character library.
length
- The length of the tokenUseful for generating auth tokens and API keys.