CryptoSys API Library Manual

MD5_StringHexHash

Creates an MD5 message digest in hexadecimal format from a message of String type.

VBA/VB6 Syntax

Public Declare Function MD5_StringHexHash Lib "diCryptoSys.dll" (ByVal strDigest As String, ByVal strMessage As String) As Long

nRet = MD5_StringHexHash(strDigest, strMessage)

C/C++ Syntax

long __stdcall MD5_StringHexHash(char *szDigest, const char *szMessage);

Parameters

szDigest
[out] to receive message digest.
szMessage
[in] containing the message to be hashed.

Returns (VBA/C)

If successful, the return value is 0; otherwise it returns a non-zero error code.

.NET Equivalent

Md5.HexHash Method (String)

COM/ASP Equivalent

md5.StringHexHash
Public Function StringHexHash(ByVal strData As String) As String

See md5.StringHexHash.

Remarks

szDigest must be at least 32 (API_MAX_MD5_CHARS) characters long (33 in a C program).

Example

    Dim nRet As Long
    Dim strDigest As String
    ' Set strDigest to be 32 chars
    strDigest = String(32, " ")
    nRet = MD5_StringHexHash(strDigest, "abc")
    Debug.Print strDigest

    nRet = MD5_StringHexHash(strDigest, _
        "abcdefghijklmnopqrstuvwxyz")
    Debug.Print strDigest

This should result in output as follows:

900150983cd24fb0d6963f7d28e17f72
c3fcd3d76192e4007dfb496cca67e13b

See Also

MD5_FileHexHash MD5_BytesHexHash

[Contents] [Index]

[PREV: MD5_Reset...]   [Contents]   [Index]   
   [NEXT: PAD_BytesBlock...]

Copyright © 2001-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-01-07T07:42:00Z.