Calculates checksum of given buffer.
Declaration Syntax
C# | Visual Basic | Visual C++ |
Protected MustOverride Function CalculateChecksum ( _ buffer As Byte(), _ offset As Integer, _ length As Integer _ ) As UShort
protected: virtual unsigned short CalculateChecksum( array<unsigned char>^ buffer, int offset, int length ) abstract
Return Value
Checksum over specified portion of buffer.
Remarks
Override with needed checksum calculation for particular protocol.
Examples
This example provides a CRC-CCITT checksum:
CopyC#
using TVA.IO.Checksums; protected override ushort CalculateChecksum(byte[] buffer, int offset, int length) { // Return calculated CRC-CCITT over given buffer... return buffer.CrcCCITTChecksum(offset, length); }