QuickHash Library Type Library


BSTR QHASH_BlockHexDigest( [ in ] int nAlgID, [ in, size_is( nSrcLength ) ]const void* pSrc, [ in ] int nSrcLength, [ in ] boolean bUpper );

Return value

The hexadecimal representation of the message digest/checksum.



    [in] The ID of the hash/checksum algorithm selected for calculations. For example, nAlgID has to be set to SHA1_ALGID when you need to calculate the digest using SHA-1 hash algorithm.

    Note. All supported hash/checksum algorithms with their corresponding IDs are specified in the Predefined Constants List.


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


    [in] Length in bytes of the memory block. 


    [in] Uppercase flag. If bUpper is False, the received message digest/checksum represents a lowercase string, otherwise it represents an uppercase string.


Calculates the message digest/checksum for a continuous memory block. The digest/checksum is returned as a hexadecimal string.

Note. If the result is an empty string call QHASH_GetLastError function for the error code.

VB Example

Private Sub MyButton_Click()
    Dim MyStrData As String
    MyStrData = "Hello World!"
    Dim nLen As Long
    nLen = Len(MyStrData)
    'Convert the string to byte array
    Dim MyBinData() As Byte
    ReDim MyBinData(1 To nLen)
    For i = 1 To nLen
        MyBinData(i) = Asc(Mid(MyStrData, i, 1))
    Next i
    'Calculate and Show the digest in hexadecimal representation
    MsgBox QHASH_BlockHexDigest( MD5_ALGID, MyBinData(1), nLen, True )
End Sub



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


See Also    QHASH_BlockDigest, QHASH_StringHexDigest, QHASH_FileHexDigest, QHASH_GetLastError



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