The calculation in a function node using BigInt can be achieived like this...
const HR0 = BigInt(msg.payload[0])
const HR1 = BigInt(msg.payload[1])
const HR2 = BigInt(msg.payload[2])
const HR3 = BigInt(msg.payload[3])
const result = (HR3 * 1000000000000n) +
(HR2 * 100000000n) +
(HR1 * 10000n) +
(HR0)
msg.payload = result
return msg;
Example...
Demo flow...
[{"id":"078ec5d1dc7504d8","type":"inject","z":"ec9cf53f5ff54f3b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":640,"y":80,"wires":[["5e61be43ece7fd86"]]},{"id":"5e61be43ece7fd86","type":"change","z":"ec9cf53f5ff54f3b","name":"Fake modbus FC3 READ 4 Registers","rules":[{"t":"set","p":"payload","pt":"msg","to":"[7131,9300,45,0]","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":80,"wires":[["d0e10296cab5f111"]]},{"id":"d0e10296cab5f111","type":"function","z":"ec9cf53f5ff54f3b","name":"function 7","func":"const HR0 = BigInt(msg.payload[0])\nconst HR1 = BigInt(msg.payload[1])\nconst HR2 = BigInt(msg.payload[2])\nconst HR3 = BigInt(msg.payload[3])\n\nconst result = (HR3 * 1000000000000n) +\n (HR2 * 100000000n) +\n (HR1 * 10000n) +\n (HR0)\nmsg.payload = result\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":790,"y":140,"wires":[["f2057fc77ed47e06"]]},{"id":"f2057fc77ed47e06","type":"debug","z":"ec9cf53f5ff54f3b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":990,"y":140,"wires":[]}]