-
-
Notifications
You must be signed in to change notification settings - Fork 4
zlib.Adler32Combine
Andrew Lambert edited this page Nov 26, 2022
·
6 revisions
zlib.Adler32Combine
Protected Function Adler32Combine(Adler1 As UInt32, Adler2 As UInt32, Length2 As UInt32) As UInt32| 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. |
The combined checksum value. You may pass this value as Adler1 on a subsequent call to continue processing.
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 IfWiki home | Project page | Bugs | Become a sponsor
Text and code examples are Copyright ©2014-24 Andrew Lambert, offered under the CC BY-SA 3.0 License.