CryptoSys PKI Pro Manual

CNV_ReverseBytes

Reverses the order of a byte array.

VBA/VB6 Syntax

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)

C/C++ Syntax

long __stdcall CNV_ReverseBytes(unsigned char *lpOutput, const unsigned char *lpInput, long nBytes);

Parameters

lpOutput
[out] byte array to receive output.
lpInput
[in] array of bytes to be reversed.
nBytes
[in] number of bytes.

Returns (VBA/C)

If successful, the return value is zero; otherwise it returns a nonzero error code.

VBA Wrapper Syntax

Public Function cnvReverseBytes (lpInput() As Byte) As Byte()

.NET Equivalent

Cnv.ReverseBytes Method

C++ (STL) Equivalent

static bvec_t dipki::Cnv::ReverseBytes (const bvec_t &data)

Python Equivalent

static Cnv.reverse_bytes(data)

Remarks

The output array lpOutput must be at least nBytes long. It may be the same variable as lpInput.

Example

 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	

See Also

[Contents] [Index]

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

Copyright © 2004-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-09-23T07:52:09Z.