Skip to content

Token Generation (token_gen.nvgt)

Token generation include

Allows you to easily generate random strings of characters of any length in a given mode.

Enums

token_gen_flag

This enum holds various constants that can be passed to the mode parameter in order to change how tokens are generated.

Functions

generate_token

Generates a string of random characters, or token.

string generate_token(int token_length, int mode = token_gen_flag_all)

Arguments:

returns:

String: a random token depending on the mode.

Remarks:

The characters used to generate the token will depend on the mode you set. See token_gen_flags enum constants.

Example:

#include "token_gen.nvgt"
void main() {
	alert("Info", "Your token is: " + generate_token(10));
	alert("Info", "Numbers only token is: " + generate_token(10, token_gen_flag_numbers));
	alert("Info", "Characters only token is: " + generate_token(10, token_gen_flag_characters));
}