Reverses the order of a byte array.
Public Declare Function CNV_ReverseBytes Lib "diCrPKI.dll" (ByRef lpOutput As Byte, ByRef lpInput As Byte, ByVal nBytes As Long) As Long
nRet = CNV_ReverseBytes(lpOutput(0), lpInput(0), nBytes)
long __stdcall CNV_ReverseBytes(unsigned char *lpOutput, const unsigned char *lpInput, long nBytes);
If successful, the return value is zero; otherwise it returns a nonzero error code.
Public Function cnvReverseBytes
(lpInput() As Byte) As Byte()
static bvec_t dipki::Cnv::ReverseBytes (const bvec_t &data)
static Cnv.reverse_bytes(data)
The output array lpOutput must be at least nBytes long. It may be the same variable as lpInput.
Dim abData() As Byte
Dim nBytes As Long
Dim nRet As Long
abData = cnvBytesFromHexStr("DEADBEEF01")
nBytes = UBound(abData) + 1
Debug.Print "INPUT: " & cnvHexStrFromBytes(abData)
nRet = CNV_ReverseBytes(abData(0), abData(0), nBytes)
Debug.Print "OUTPUT: " & cnvHexStrFromBytes(abData)
INPUT: DEADBEEF01 OUTPUT: 01EFBEADDE