Example Flow using npm atob library :
[{"id":"be4cb634d6fc8b19","type":"inject","z":"5847b7aa62131d37","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":220,"y":600,"wires":[["08068f0eee8663e5"]]},{"id":"08068f0eee8663e5","type":"function","z":"5847b7aa62131d37","name":"prepare req","func":"msg = {\n\n method: 'post',\n url: 'https://192.168.30.51/api/salt',\n headers: {\n 'Content-Type': 'application/json'\n },\n payload: JSON.stringify({ \"username\": \"Innotech\" })\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":410,"y":600,"wires":[["de23c9b11c6a7aa8","578d3d4950128bc2"]]},{"id":"de23c9b11c6a7aa8","type":"http request","z":"5847b7aa62131d37","name":"","method":"use","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"x":610,"y":600,"wires":[["8322c617ff387fcc","69fc0d787e6d1653"]]},{"id":"578d3d4950128bc2","type":"debug","z":"5847b7aa62131d37","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":530,"y":540,"wires":[]},{"id":"8322c617ff387fcc","type":"debug","z":"5847b7aa62131d37","name":"salt","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":730,"y":540,"wires":[]},{"id":"69fc0d787e6d1653","type":"function","z":"5847b7aa62131d37","name":"prepare req","func":"let salt = msg.payload.client_salt;\nlet credential = \"<your_cretential>\"\nlet username = \"<your_username>\"\n\nconst concats = credential + atob(salt)\nconst notbase64 = sha256(Latin1.parse(concats))\nconst hashedCredential = Base64.stringify(notbase64)\nlet hashCredentials = base64url.fromBase64(hashedCredential)\n\nnode.warn({hashCredentials}) // log hashCredentials\n\n\nlet data = `{\\r\\n \"username\": \"${username}\", \\r\\n \"password\": \"${hashCredentials}\" \\r\\n}`;\n\n msg = {\n method: 'post',\n url: 'https://192.168.30.51/api/token',\n headers: { \n 'Content-Type': 'application/json'\n },\n payload : data\n};\n\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"sha256","module":"crypto-js/sha256"},{"var":"base64url","module":"base64url"},{"var":"Base64","module":"crypto-js/enc-base64"},{"var":"Latin1","module":"crypto-js/enc-latin1"},{"var":"atob","module":"atob"}],"x":840,"y":600,"wires":[["12bf0194cfc78c44","a697a6653bd2cfee"]]},{"id":"f616a86568848154","type":"inject","z":"5847b7aa62131d37","name":"Test salt","props":[{"p":"payload.client_salt","v":"uJXCKFT2M6JhVvi5tIAGwfSWZ4AXvK80a2t8Ararqps=","vt":"str"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"str","x":680,"y":700,"wires":[["69fc0d787e6d1653"]]},{"id":"12bf0194cfc78c44","type":"debug","z":"5847b7aa62131d37","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":950,"y":540,"wires":[]},{"id":"a697a6653bd2cfee","type":"http request","z":"5847b7aa62131d37","name":"","method":"use","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"x":1050,"y":600,"wires":[["a94527145710a597"]]},{"id":"a94527145710a597","type":"debug","z":"5847b7aa62131d37","name":"token","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1210,"y":600,"wires":[]}]