checkCRC ensures that the CRC matches with the one from the reader.
(r io.Reader, expect uint32)
| 743 | |
| 744 | // checkCRC ensures that the CRC matches with the one from the reader. |
| 745 | func checkCRC(r io.Reader, expect uint32) error { |
| 746 | msgCRC, err := extractUint32(r) |
| 747 | if err != nil { |
| 748 | return err |
| 749 | } |
| 750 | |
| 751 | if msgCRC != expect { |
| 752 | return fmt.Errorf("Checksum Mismatch, MessageCRC of 0x%X does not equal expected CRC of 0x%X", msgCRC, expect) |
| 753 | } |
| 754 | return nil |
| 755 | } |
no test coverage detected