Skip to content

zlib.Adler32Combine

Andrew Lambert edited this page Nov 26, 2022 · 6 revisions

zlib.Adler32Combine

Method Signature

 Protected Function Adler32Combine(Adler1 As UInt32, Adler2 As UInt32, Length2 As UInt32) As UInt32

Parameters

Name Type Comment
Adler1 UInt32 The running Adler32 checksum to combine with Adler2.
Adler2 UInt32 The Adler32 checksum to be combined with Adler1.
Length2 UInt32 The length of the original data used to compute Adler2, in bytes.

Return value

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

Remarks

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

In other words:

  Dim seq1 As String = "Hello, "
  Dim seq2 As String = "World!"
  Dim a1 As UInt32 = zlib.Adler32(seq1)
  Dim a2 As UInt32 = zlib.Adler32(seq2)
  Dim combinedadler As UInt32 = zlib.Adler32Combine(a1, a2, seq2.LenB)
  If combinedadler = zlib.Adler32(seq1 + seq2) Then
    MsgBox("Checksums match")
  End If

See also

Entry-level points of interest denoted by "☜"



Clone this wiki locally