Contents 

SlavaSoft FastCRC Library Online Help

Prev Page Next Page
FastCRC Library Type Library

FCRC32_Calculate

long FCRC32_Calculate( [ in , size_is( nSrcLength ) ] const void* pSrc, [ in ] int nSrcLength );

Return value

The checksum.

Parameters

 pSrc

    [in] A continuous memory block for which to calculate the checksum.

 nSrcLength

    [in] Length in bytes of the memory block. 

Remarks

Calculates the checksum for the memory block specified by pSrc.

VB Example

Private Sub MyButton_Click()   
   Dim strdata As String
   strdata = "Hello World!"

   Dim strlength As Long
   strlength = Len(strdata)

   'Convert the string to byte array
   Dim bindata() As Byte
   ReDim bindata(1 To strlength)
   For i = 1 To strlength
      bindata(i) = Asc(Mid(strdata, i, 1))
   Next i

   'Get the checksum
   Dim checksum As Long
   checksum = FCRC32_Calculate(bindata(1), strlength)

   'Show the hexadecimal representation of the checksum
   MsgBox FCRC_LongToHex32(checksum, True)
End Sub

 

 

Type Library Overview   |   Type Library Functions   |   Useful Links   |   HashCalc

 

See Also    FCRC32_CalculateStr, FCRC32_CalculateFile, FCRC_LongToHex32 


 

 

Send Feedback to SlavaSoft Inc. Tell a friend about FastCRC Library