CryptoSys PKI Pro Manual

COMPR_Uncompress

Uncompress data using zlib compression.

VBA/VB6 Syntax

Public Declare Function COMPR_Uncompress Lib "diCrPKI.dll" (ByRef lpOutput As Byte, ByVal nOutBytes As Long, ByRef lpInput As Byte, ByVal nInputLen As Long, ByVal nOptions As Long) As Long

nRet = COMPR_Uncompress(lpOutput(0), nOutputLen, lpInput(0), nInputLen, 0) ' Note the "(0)" after the byte array parameters

C/C++ Syntax

long __stdcall COMPR_Uncompress(unsigned char *lpOutput, long nOutBytes, const unsigned char *lpInput, long nInputLen, long nOptions);

Parameters

lpOutput
[out] byte buffer to receive output data.
nOutBytes
[in] size of the output buffer in bytes.
lpInput
[in] input data to be uncompressed.
nInputLen
[in] length of input array in bytes.
nOptions
[in] option flags. Not used in this release. Set to zero.

Returns (VBA/C)

The number of bytes successfully copied into the output buffer or the required size in bytes. If an error occurs, it returns a negative error code.

VBA Wrapper Syntax

Public Function comprUncompress (lpInput() As Byte, Optional nOptions As Long = 0) As Byte()

.NET Equivalent

Compr.Uncompress Method

C++ (STL) Equivalent

static bvec_t dipki::Compr::Uncompress (const bvec_t &data)

Python Equivalent

static Compr.uncompress(data)

Remarks

To determine the required size of the output buffer, call the function with nOutBytes set to zero (or lpOutput set to NULL).

Example (VBA core function)

See COMPR_Compress.

Example (VBA wrapper function)

Dim strPlain As String
Dim lpToCompress() As Byte
Dim lpCompressed() As Byte
Dim lpUncompressed() As Byte
strPlain = "hello, hello, hello. This is a 'hello world' message " & _
    "for the world, repeat, for the world."
lpToCompress = StrConv(strPlain, vbFromUnicode)
lpCompressed = comprCompress(lpToCompress)
Debug.Print "OK=        " & "789CCB48CDC9C9D751C840A2F4144232328B15802851411D2CA2509E5F9493A2AE909B5A5C9C989EAA90965FA45092910A11D651284A2D484D2CD14115D6030086D11F4E"
Debug.Print "COMPRESSED=" & cnvHexStrFromBytes(lpCompressed)
lpUncompressed = comprUncompress(lpCompressed)
Debug.Print "'" & StrConv(lpUncompressed, vbUnicode); "'"

See Also

COMPR_Compress

[Contents] [Index]

[PREV: COMPR_Compress...]   [Contents]   [Index]   
   [NEXT: ECC_DHSharedSecret...]

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