Xceed Streaming Compression Library Documentation
Xceed Streaming Compression control reference / Methods / CalculateChecksum method
In This Topic
    CalculateChecksum method
    In This Topic

    Description

    The CalculateChecksum method computes an Adler-32 or CRC checksum on a block of data. If you are dealing with streaming data, this method can also be used to compute a running checksum. It is provided as a convenience feature for developers that need to calculate a checksum on data without compressing it at all.

    Parameters
     

    Parameter Description
    vaData  The data to compute a checksum for.
    ChecksumType  Selects the type of checksum. Specify cctCRC32 to have the library compute a CRC-32 checksum. Specify cctAdler32 for an Adler-32 checksum.
    lPreviousChecksum  Specify 0 if this is the first (or the only) block of data you want to compute a checksum for. If you are dealing with streaming data and have already computed the checksum for previous data, specify the previously returned checksum so that it can be updated.

    Return value

    Returns the computed checksum.

    Declaration (DXceedStreamingCompression) Copy Code
    HRESULT CalculateChecksum
    (
      [in] VARIANT* vaData,
      [in] EXCChecksumType ChecksumType,
      [in] long lPreviousChecksum,
      [out, retval] long* lNewChecksum
    )
    Declaration (IXceedStreamingCompression) Copy Code

    HRESULT CalculateChecksum
    (
      [in, size_is(dwDataSize)] BYTE* pcData,
      [in] DWORD dwDataSize,
      [in] EXCChecksumType,
      [in] DWORD dwPreviousCRC,
      [out] DWORD* pdwNewCRC
    )