ECLCompressAndEncryptBuffer
Compresses and/or encrypts data from the specified buffer.
Unit
EasyCompression
function ECLCompressAndEncryptBuffer(InBuf: PChar; InSize: Integer; out OutBuf: PChar; out OutSize: Integer; Password: string = ''; CompressionLevel: TECLCompressionLevel = DefaultCompressionLevel; bNoCRC: Boolean = True): Boolean;
Description
Call ECLCompressAndEncryptBuffer to compress and/or encrypt data from the source buffer to the specified destination buffer.
This function returns True if the compression and/or encryption completed without errors or False if any error occurred.
InBuf represents the pointer to the source buffer.
InSize specifies the size of the source buffer
OutBuf contains the result pointer to the automatically allocated (by AllocMem) destination buffer with compressed and/or encrypted data.
OutSize indicates the final size of the compressed data.
If Password is not blank, it is used to encrypt the data.
CompressionLevel specifies the level of compression to be used.
bNoCRC specifies whether CRC-32 will be added to compressed data to be used for verification while decompressing.
Note:
This function always adds an internal header to the compressed data, so if you use eclNone level ECLCompressAndEncryptBuffer is not equal to the standard Move procedure.
|