Skip to content
Andrew Lambert edited this page Nov 26, 2022 · 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.

Remarks

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.)

See also

Entry-level points of interest denoted by "☜"



Clone this wiki locally