-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Function syntax: `string generate_custom_token(int token_length, string characters);` * `generate_token` function now uses the custom function to generate the characters depending on the mode.
- Loading branch information
1 parent
fa78826
commit fa13ae0
Showing
5 changed files
with
29 additions
and
7 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
doc/src/references/include/Token Generation (token_gen.nvgt)/!token_gen.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# Token generation include | ||
Allows you to easily generate random strings of characters of any length in a given mode. | ||
Allows you to easily generate random strings of characters of any length in a given mode, and possibly custom function if you want to generate only certain characters. |
2 changes: 1 addition & 1 deletion
2
...rc/references/include/Token Generation (token_gen.nvgt)/Enums/token_gen_flag.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...references/include/Token Generation (token_gen.nvgt)/Functions/generate_custom_token.nvgt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
Generates a string of random characters, or token base on the characters you set. | ||
string generate_custom_token(int token_length, characters); | ||
## Arguments: | ||
* int token_length: the length of the token to generate. | ||
* string characters: a list of characters to generate. | ||
## returns: | ||
String: a random token. | ||
## Remarks: | ||
If characters list is empty or token length is set to 0 or less, an empty string is returned. | ||
*/ | ||
|
||
// Example: | ||
#include "token_gen.nvgt" | ||
|
||
void main() { | ||
alert("Info", "Your A to C token is: " + generate_custom_token(10, "abc")); | ||
alert("Info", "A to C with capitals included token is: " + generate_custom_token(10, "abcABC")); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters