Help on CRC-8 function

Assuming you meant 0x74 0x52 0x07 0x02 0x03 0x15 0xd2 has a CRC of 0xd2 then even that C code doesnt give 0xd2

Assuming you meant 0x74 0x52 0x07 0x02 0x03 0x15 has a CRC of 0xd2 then even that C code doesnt give 0xd2 - you get 67 (or 0x43)

C version...
image
Click here to see it in action

Additionally, my interpretation of that c code in JS function results in the same CRC

[{"id":"aa6441fb.6f381","type":"function","z":"56a2925d.72edac","name":"Calc CRC","func":"var crc= 0x85;\nvar poly= 0xFF;\n\nvar buf= msg.payload;\n\nfor (let i=0; i < buf.length; i++) {\n    crc = (crc ^ (buf.readUInt8(i) & 0xff)) & 0xff\n    for (let j=0; j < 8; j++) {\n        if ((crc & 0x80)==0x80) {\n            crc =  ( ((crc<<1) & 0xff) ^ poly) & 0xff;\n        } else {\n            crc = ((crc & 0xff) << 1) & 0xff;\n        }\n    }\n}\n\nmsg.crc = crc;\nmsg.crchex = crc.toString(16);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":900,"y":200,"wires":[["9cd60bb9.e21668"]]},{"id":"9d48507f.9343c","type":"inject","z":"56a2925d.72edac","name":"as hex string 745207020315","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"hex string 745207020315","payload":"745207020315","payloadType":"str","x":620,"y":140,"wires":[["1bf1e4.0d454e1d"]]},{"id":"1bf1e4.0d454e1d","type":"function","z":"56a2925d.72edac","name":"to buffer","func":"msg.payload = Buffer.from(msg.payload,\"hex\")\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":880,"y":140,"wires":[["aa6441fb.6f381"]]},{"id":"9cd60bb9.e21668","type":"debug","z":"56a2925d.72edac","name":"crc","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"crc","statusType":"msg","x":1050,"y":200,"wires":[]},{"id":"6634df59.7895f","type":"inject","z":"56a2925d.72edac","name":"as buffer [116 ,82 ,7 ,2 ,3 ,21]","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"buffer [116 ,82 ,7 ,2 ,3 ,21]","payload":"[116 ,82 ,7 ,2 ,3 ,21]","payloadType":"bin","x":620,"y":240,"wires":[["aa6441fb.6f381"]]},{"id":"ac80a6c.4707958","type":"inject","z":"56a2925d.72edac","name":"as hex string 745207020315d2","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"hex string 745207020315d2","payload":"745207020315d2","payloadType":"str","x":630,"y":100,"wires":[["1bf1e4.0d454e1d"]]},{"id":"f03c1bd1.83ecb8","type":"inject","z":"56a2925d.72edac","name":"as buffer [116 ,82 ,7 ,2 ,3 ,21 ,210]","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"buffer [116 ,82 ,7 ,2 ,3 ,21 ,210]","payload":"[116 ,82 ,7 ,2 ,3 ,21, 210]","payloadType":"bin","x":640,"y":200,"wires":[["aa6441fb.6f381"]]}]