k-o-e
4/14/2020 - 7:50 PM

Random String/Number Generator

function makeRandomNumber()
{
    var text = "";
    var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

    for( var i=0; i < 10; i++ )
        text += possible.charAt(Math.floor(Math.random() * possible.length));

    return text;
}


//another possible way is using Math.random()
Math.random().toString(36).substr(2,10)