CryptoSys API Library Manual

CNV_HexStrFromBytes

Encodes an array of bytes into a hexadecimal-encoded string.

VBA/VB6 Syntax

Public Declare Function CNV_HexStrFromBytes Lib "diCryptoSys.dll" (ByVal strOutput As String, ByVal nMaxChars As Long, ByRef lpData As Byte, ByVal nBytes As Long) As Long

nRet = CNV_HexStrFromBytes(strOutput, nMaxChars, abData(0), nDataLen)

C/C++ Syntax

long __stdcall CNV_HexStrFromBytes(char *szOutput, long nMaxChars, const unsigned char *lpInput, long nBytes);

Parameters

szOutput
[out] to receive encoded data.
nMaxChars
[in] specifying the maximum number of characters to be received.
lpInput
[in] array of binary data to be encoded.
nBytes
[in] number of bytes to be encoded.

Returns (VBA/C)

If successful, the return value is the number of characters in the encoded string; otherwise it returns a negative error code.

VBA Wrapper Syntax

Public Function cnvHexStrFromBytes(lpData() As Byte) As String

.NET Equivalent

Cnv.ToHex Method (Byte[])

COM/ASP Equivalent

conv.HexFromBytes
Public Function HexFromBytes(ByVal abData As Variant) As String

See conv.HexFromBytes.

C++ (STL) Equivalent

static std::string crsysapi::Cnv::ToHex (const bvec_t &bv)
static std::string crsysapi::Cnv::ToHex (const std::string &s)

Python Equivalent

static Cnv.tohex(data)

Remarks

For the "raw" function, specify a zero nOutChars or a null string for szOutput to find the required length of the output string. C/C++ users must add one to this value when allocating memory.

Example

See Also

CNV_BytesFromHexStr CNV_HexFilter

[Contents] [Index]

[PREV: CNV_HexFilter...]   [Contents]   [Index]   
   [NEXT: CNV_ShortPathName...]

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