[ { "id": "d752e739.4cfbd8", "type": "comment", "z": "9c3b70b.7f4189", "name": "Lliçó 3.16", "info": "Aquest és un exemple de la tercera lliçó.\n\nwiki.binefa.cat\n", "x": 300, "y": 640, "wires": [] }, { "id": "6f07e0fb.a6195", "type": "inject", "z": "9c3b70b.7f4189", "name": "", "topic": "", "payload": "Un text qualsevol", "payloadType": "str", "repeat": "", "crontab": "", "once": false, "x": 350, "y": 680, "wires": [ [ "862b59d9.4e8338" ] ] }, { "id": "a6750310.ebc11", "type": "debug", "z": "9c3b70b.7f4189", "name": "En base64", "active": true, "console": "false", "complete": "payload", "x": 850, "y": 680, "wires": [] }, { "id": "862b59d9.4e8338", "type": "function", "z": "9c3b70b.7f4189", "name": "A base64 (UTF8 -> Base64)", "func": "var b = new Buffer(msg.payload);\nmsg.payload = b.toString('base64');\n\nreturn msg;", "outputs": 1, "noerr": 0, "x": 600, "y": 680, "wires": [ [ "a6750310.ebc11", "d5999c30.e5cdc", "fb4aa701.a70ec8" ] ] }, { "id": "d5999c30.e5cdc", "type": "function", "z": "9c3b70b.7f4189", "name": "Des de base64 (Base64 -> UTF-8)", "func": "var b = new Buffer(msg.payload, 'base64');\nmsg.payload = b.toString();\n\nreturn msg;", "outputs": 1, "noerr": 0, "x": 580, "y": 740, "wires": [ [ "e0bd0693.10c398" ] ] }, { "id": "e0bd0693.10c398", "type": "debug", "z": "9c3b70b.7f4189", "name": "Descodificat", "active": true, "console": "false", "complete": "payload", "x": 850, "y": 740, "wires": [] }, { "id": "e7910218.cf942", "type": "function", "z": "9c3b70b.7f4189", "name": "HEX -> UTF8", "func": "var b = new Buffer(msg.payload, 'hex')\nmsg.payload = b.toString('utf8');\n\nreturn msg;", "outputs": 1, "noerr": 0, "x": 640, "y": 860, "wires": [ [ "efa5d9d9.14cbf8" ] ] }, { "id": "fb4aa701.a70ec8", "type": "function", "z": "9c3b70b.7f4189", "name": "Base64 -> HEX", "func": "var b = new Buffer(msg.payload, 'base64')\nmsg.payload = b.toString('hex');\n\nreturn msg;\n", "outputs": 1, "noerr": 0, "x": 640, "y": 800, "wires": [ [ "e7910218.cf942", "d86fcb28.d0e768" ] ] }, { "id": "d86fcb28.d0e768", "type": "debug", "z": "9c3b70b.7f4189", "name": "En hexadecimal", "active": true, "console": "false", "complete": "payload", "x": 850, "y": 800, "wires": [] }, { "id": "efa5d9d9.14cbf8", "type": "debug", "z": "9c3b70b.7f4189", "name": "HEX a String", "active": true, "console": "false", "complete": "payload", "x": 840, "y": 860, "wires": [] } ]