CryptoSys API Library Manual

SHA2_HexDigest

Returns the final message digest value as a hex string.

VB6/VBA Syntax

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

nRet = SHA2_HexDigest(strDigest, hContext)

Parameters

strDigest
[out] String variable long enough to receive the final message digest.
hContext
[in] Long handle to the SHA-1 context.

C/C++ Syntax

long _stdcall SHA2_HexDigest(char *strDigest, long ctx_handle);

Returns (VB6/C)

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

.NET Equivalent

Sha256.HexDigest Method

Remarks

This operation delivers the result of Add operations since the last Init or Reset operation. The handle to the context hContext must have been set up with a prior call to SHA1_Init. The string variable strDigest must have been set up with at least 64 (API_MAX_SHA2_CHARS) characters (65 in a C program) to receive the digest value in hex format. Note that this digest operation is a destructive, read-once operation. Once it has been performed, the context must be reset before being used to calculate another digest value.

Example

See SHA2_AddString and SHA2_AddBytes

See Also

SHA2_Init SHA2_AddString SHA2_AddBytes SHA2_Reset

[Contents] [Index]

[HOME]   [NEXT: SHA2_Hmac...]

Copyright © 2001-11 D.I. Management Services Pty Ltd. All rights reserved.