Skip to content

Instantly share code, notes, and snippets.

View peterkaminski's full-sized avatar

Peter Kaminski peterkaminski

View GitHub Profile
@felixzapata
felixzapata / gist:9320651
Created March 3, 2014 08:19
generate a random number and convert it to base 36
var rand = function() {
return Math.random().toString(36).substr(2); // remove `0.`
};
var token = function() {
return rand() + rand(); // to make it longer
};
token(); // "bnh5yzdirjinqaorq0ox1tf383nb3xr"