1'use strict';
2
3let data = 'stackabuse.com';
4let buff = new Buffer(data);
5let base64data = buff.toString('base64');
6
7console.log('"' + data + '" converted to Base64 is "' + base64data + '"');
8
1eyJuYW1laWQiOiI2MDY3IiwibmJmIjoxNjIzODM3MTAzLCJleHAiOjE2MjM4ODAzMDMsImlhdCI6MTYyMzgzNzEwM30