-
-
Notifications
You must be signed in to change notification settings - Fork 3
zlib.CRC32
Andrew Lambert edited this page Oct 26, 2016
·
12 revisions
#zlib.CRC32
##Method Signature
Protected Function CRC32(NewData As MemoryBlock, LastCRC As UInt32 = 0, NewDataSize As Integer = -1) As UInt32
##Parameters
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. |
##Return value
The checksum value. You may pass this value as LastCRC
on a subsequent call to continue processing.
##Notes
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
(e.g. converted from a Ptr or returned from a declare.)
##See also
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.