I want to create a random string (token) which can be used to identify a user whilst avoiding any potential conflicts with any other users\' tokens.
What I was thinking
This function allows you to set the token length and allowed characters.
function generate_token(length){
//edit the token allowed characters
var a = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890".split("");
var b = [];
for (var i=0; i
Simply call generate_token
generate_token(32); //returns "qweQj4giRJSdMNzB8g1XIa6t3YtRIHPH"