getID
Generate a random ID.
By default, getID generates a random string with 22 characters:
//Importvar getID = ; //Generate a random string IDvar id = ; //Returns 'c14x5E22610MJqk8J15748', for example
You can use it with some options:
Option | Description |
---|---|
length | Set the length of the generated string. Default is 22. |
prefix | Set a prefix for the generated string. |
suffix | Set a suffix for the generated string. |
Example:
var getID = ; //Generate a random string with optionsvar id = ; //Returns 'ID4F52M26448'