Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

nodejs string to base64

> console.log(Buffer.from("Hello World").toString('base64'));
SGVsbG8gV29ybGQ=
> console.log(Buffer.from("SGVsbG8gV29ybGQ=", 'base64').toString('ascii'))
Hello World
Comment

Encoding and Decoding Base64 Strings in Node.js

'use strict';

let data = 'stackabuse.com';
let buff = new Buffer(data);
let base64data = buff.toString('base64');

console.log('"' + data + '" converted to Base64 is "' + base64data + '"');
Comment

Decodes a string of data which has been encoded using base-64 encoding - Nodejs

const atob = str => Buffer.from(str, 'base64').toString('binary'); atob('Zm9vYmFy'); // 'foobar'
Comment

PREVIOUS NEXT
Code Example
Javascript :: tailwind css toggle switch react 
Javascript :: angular disable select dropdown 
Javascript :: to find keys in an object 
Javascript :: TypeError: navigation.getParams is not a function. 
Javascript :: Not Found The requested URL was not found on this server angular routing when going back to site from ecternal source 
Javascript :: getting te value of select multiple value 
Javascript :: get current location city name react native 
Javascript :: javascript get smaller of two numbers 
Javascript :: filter react 
Javascript :: jquery: finding all the elements containing the text present in an array 
Javascript :: js replace diacritics 
Javascript :: change color react icon 
Javascript :: react router dom props.history is undefined 
Javascript :: print array without brackets javascript 
Javascript :: react render twice v18 
Javascript :: javascript add element to serialized form array 
Javascript :: get all object key names 
Javascript :: react owl-carousel 
Javascript :: javascript full date as string 
Javascript :: plotly express bar graph 
Javascript :: javascript html video seek to time 
Javascript :: get role id from role position 
Javascript :: convert days in years js 
Javascript :: Get width of screen on resize event 
Javascript :: How to fetch data from an api async and await 
Javascript :: display for sometime only session flash message in laravel with javascript 
Javascript :: for in js 
Javascript :: autocomplete react jsx attributes vscode 
Javascript :: popper.js and jquery 
Javascript :: try catch with for loop in javascript 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =