two types of check sum function

First is intel method.
Second is motorora method.

Check sum used to check for packet confidence in serial communication.

refer to this below code

<gist>

</gist>