Removes non-hexadecimal characters from a string.
Public Declare Function CNV_HexFilter Lib "diCrPKI.dll"
(ByVal strOutput As String, ByVal strInput As String, ByVal nStrLen As Long) As Long
nRet = CNV_HexFilter(strOutput, strInput, nStrLen)
long __stdcall CNV_HexFilter(char *szOutput, const char *szInput, long nStrLen);
If successful, the return value is the number of characters in the filtered string; otherwise it returns a negative error code.
Public Function cnvHexFilter
(szHex As String) As String
Specify a zero nOutChars or an empty string for szOutput to find the required length of the output string. ANSI C users must add one to this value when allocating memory.
Assumes that the output string is at least as long as the input string.
Wrapper function to return a filtered string directly:
Public Function cnvHexFilter(strHex As String) As String
Dim strFiltered As String
Dim nDataLen As Long
strFiltered = String(Len(strHex), " ")
nDataLen = CNV_HexFilter(strFiltered, strHex, Len(strHex))
strFiltered = Left$(strFiltered, nDataLen)
cnvHexFilter = strFiltered
End Function
CNV_HexStrFromBytes CNV_BytesFromHexStr