Mavlink2 calculating checksum

Hello, I am sending custom mavlink messages to a flight controller and for some specific testing I am required to manually send the raw messages. I have the bytes of the message and payload however I cannot complete the message without the uint16_t checksum at the end. Could someone please advise me on how to calculate these bytes from the existing bytes in the message?

You need to generate the C (or other language) header for the custom message that you want to use.

Have a look here: C (mavgen) ยท MAVLink Developer Guide