Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

generate random base 64 string js

function getRandomString(length) {
    var randomChars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_';
    var result = '';
    for ( var i = 0; i < length; i++ ) {
        result += randomChars.charAt(Math.floor(Math.random() * randomChars.length));
    }
    return result;
}

var randomString = getRandomString(16); //get random alphanumberic 16 char string
 
PREVIOUS NEXT
Tagged: #generate #random #base #string #js
ADD COMMENT
Topic
Name
2+1 =