base64 in Nodejs and Java
From : https://www.hacksparrow.com/nodejs/base64-encoding-decoding-in-node-js.html let secretBase64 = Buffer.from(“ JavaScript ”).toString('base64'); // SmF2YVNjcmlwdA== var b = new Buffer('JavaScript'); // Buffer var s = b.toString('base64'); // SmF2YVNjcmlwdA== var b = new Buffer('SmF2YVNjcmlwdA==', 'base64') var s = b.toString(); // JavaScript // ------------------- var b = new Buffer('SmF2YVNjcmlwdA==', 'base64') var s = b.toString('hex'); // 4a617661536372697074 var b = new Buffer('4a617661536372697074', 'hex') var s = b.toString('utf8'); // JavaScript //---------------------- $node >require('crypto').randomBytes(64).toString('hex') f3a302c14cd2f57bc6972a0d599857dbde877fbf03b38dd592b9635bc7f30299c9d5dfe44e5abb615737cf40a45958c8283b5d1132c4e7e0d8e66610044be1f4 https://expressjs.com/en/api.html var fs = require('fs' ); // function to encode file data to base64 enc...