nodejs string to base64
> console.log(Buffer.from("Hello World").toString('base64'));
SGVsbG8gV29ybGQ=
> console.log(Buffer.from("SGVsbG8gV29ybGQ=", 'base64').toString('ascii'))
Hello World> 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:
- how to revert angular cli version
- React Children map example
- how to check the ID token in aws lambda in node js
- check if js object is empty
- express route parameters
- disable textbox on plumsail
- how to get url node
- javascript non-repeating randomize array
- parse date from string in js
- how to write in js
- How to add a new item to an object at a specific position with vanilla JS
- react conditional class
- javascript map over new array
- json syntax
- prevent click other tab bootstrap tabs
- javascript how to split array into subarrays javascript
- Build JavaScript Objects
- tinymce count characters
- javascript pass this to callback
- points in three js
- nesting in Jinja2 expressions
- npm ERR! Unexpected end of JSON input while parsing near '...ty":"sha512-2GTXt3b2Q'
- how to make so chrome open closed tabs automatically
- récupérer la position d'un élément javascript