Added a function to validate messages by their checksum.