-
-
Notifications
You must be signed in to change notification settings - Fork 3
zlib.CRC32Combine
Andrew Lambert edited this page Nov 26, 2022
·
11 revisions
zlib.CRC32Combine
Protected Function CRC32Combine(CRC1 As UInt32, CRC2 As UInt32, Length2 As UInt32) As UInt32
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. |
The combined checksum value. You may pass this value as CRC1
on a subsequent call to continue processing.
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
Wiki 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.