Encoding and Decoding Base64 Strings in Node.js
> console.log(Buffer.from("Hello World").toString('base64'));
SGVsbG8gV29ybGQ=
> console.log(Buffer.from("SGVsbG8gV29ybGQ=", 'base64').toString('ascii'))
Hello World
'use strict';
let data = 'stackabuse.com';
let buff = new Buffer(data);
let base64data = buff.toString('base64');
console.log('"' + data + '" converted to Base64 is "' + base64data + '"');
Also in JavaScript:
- shuffle an array of numbers in javascript
- get ascii value of char javascript
- number to binary javascript
- get params from route vuejs
- js generator
- jquery enforce important
- react pass parameters to other page
- compare two dates using moment
- remove in javascript
- javascript getmonth
- How to call the ajax when form is valid
- bootstrap set active tab javascript
- square brackets vs curly brackets javascript
- stopped typing jquery
- js remove spaces
- ejecutar una funcion js con id html usando jquery
- json minecraft
- javascript audio duration property returns infinity
- react forms
- javascript on click radio button get value
- foreach loop js arrow functons
- error build react Failed to execute 'replaceState' on 'History': A history state object with URL 'file:///' cannot be created in a document with origin 'null' and URL
- public class NameOf { public static String nameof<T>(Expression<Func<T>> name) { MemberExpression expressionBody = (MemberExpression)name.Body; return expressionBody.Member.Name; } }
- install vue js