Skip to content
Andrew Lambert edited this page Nov 26, 2022 · 11 revisions

zlib.CRC32Combine

Method Signature

 Protected Function CRC32Combine(CRC1 As UInt32, CRC2 As UInt32, Length2 As UInt32) As UInt32

Parameters

Name Type Comment
CRC1 UInt32 The running CRC to combine with CRC2.
CRC2 UInt32 The CRC to be combined with CRC1.
Length2 UInt32 The length of the original data used to compute CRC2, in bytes.

Return value

The combined checksum value. You may pass this value as CRC1 on a subsequent call to continue processing.

Remarks

For two sequences of bytes, seq1 and seq2 with lengths len1 and len2, CRC32 checksums crc1 and crc2 were calculated. This function computes the CRC32 checksum of seq1 and seq2 concatenated, using only crc1, crc2, and len2.

In other words:

  Dim seq1 As String = "Hello, "
  Dim seq2 As String = "World!"
  Dim crc1 As UInt32 = zlib.CRC32(seq1)
  Dim crc2 As UInt32 = zlib.CRC32(seq2)
  Dim combinedcrc As UInt32 = zlib.CRC32Combine(crc1, crc2, seq2.LenB)
  If combinedcrc = zlib.CRC32(seq1 + seq2) Then
    MsgBox("Checksums match")
  End If

See also

Entry-level points of interest denoted by "☜"



Clone this wiki locally