Horje
js code to generate random base64 code Code Example
js code to generate random base64 code
var string = "Hello folks how are you doing today?";
var encodedString = btoa(string); // Base64 encode the String
var decodedString = atob(encodedString); // Base64 decode the String
how to generate random character from an array js
function makeid() {
  var text = "";
  var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

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

  return text;
}

console.log(makeid());
js code to generate random base64 code
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 randString = getRandomString(20);//get rand alphanumberic 20 char string
var randBase64String = btoa(randString); // Base64 encode the String




Javascript

Related
Type 'IterableIterator<[number, Module]>' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators. Code Example Type 'IterableIterator<[number, Module]>' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators. Code Example
execute javascript function when page loads Code Example execute javascript function when page loads Code Example
angular ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Code Example angular ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Code Example
base64 decode javascript Code Example base64 decode javascript Code Example
console.log object at current state Code Example console.log object at current state Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8