-
-
Notifications
You must be signed in to change notification settings - Fork 3
zlib.CRC32
Andrew Lambert edited this page Nov 26, 2022
·
12 revisions
zlib.CRC32
Protected Function CRC32(NewData As MemoryBlock, LastCRC As UInt32 = 0, NewDataSize As Integer = -1) As UInt32
Name | Type | Comment |
---|---|---|
NewData | MemoryBlock | The next chunk of data to process |
LastCRC | UInt32 | Optional. If specified, a previous return value. |
NewDataSize | Integer | Optional. If specified, the size of NewData in bytes. |
The checksum value. You may pass this value as LastCRC
on a subsequent call to continue processing.
This function computes a CRC32 checksum. You may continue processing from a previous call by passing the return value as LastCRC
.
For example:
Dim c1 As UInt32 = zlib.CRC32("Hello, ")
Dim c2 As UInt32 = zlib.CRC32("World!", c1) ' continue from c1
If zlib.CRC32("Hello, World!") = c2 Then
MsgBox("Checksums match")
End If
You only need to pass NewDataSize
if NewData.Size=SizeUnknown
(i.e. converted from a Ptr.)
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.