Creates a message digest hash in hexadecimal format from data in a hexadecimal-encoded string. The hash algorithm to use is passed in the options parameter.
Public Declare Function HASH_HexFromHex Lib "diCryptoSys.dll"
(ByVal strOutput As String, ByVal nMaxChars As Long, ByVal strMsgHex As String, ByVal nOptions As Long) As Long
nRet = HASH_HexFromHex(strOutput, nMaxChars, strMsgHex, nOptions)
String to receive hash digest in hexadecimal format.Long specifying the maximum number of characters to be received.String containing the message data in hexadecimal-encoded format.Long Option flags. Select one of:
long _stdcall HASH_HexFromHex(char *szOutput, long nMaxChars, const char *szMsgHex, long nOptions);
Long: If successful, the return value is the number of characters in the output string;
otherwise it returns a negative error code.
Specify a zero nOutChars or an empty ("") or NULL strOutput parameter
to find out the required length of the output string.
The maximum number of characters is API_MAX_HASH_CHARS.
Hint: SHA-1 requires 40 (API_SHA1_CHARS) characters; MD5 and MD2 require 32 characters.
C/C++ users should add one to this value
before allocating memory. The final digest will be truncated to the specified length if less than the
expected size. Only lower-case letters [a-f] are used in the output.
Dim strDigest As String
Dim nRet As Long
Dim strData As String
strDigest = String(API_SHA1_CHARS, " ")
strData = "616263"
nRet = HASH_HexFromHex(strDigest, Len(strDigest), strData, API_HASH_SHA1)
Debug.Print strDigest