Last update: Fri Nov 13 10:43:18 2009


Download RSPmfce files

Project detail and discuss

SourceForge.net

RSPmfce



rspmfce

 


Win32 DLL to compress memory or files using zlib, bzip2 or lzo , the integrity check is provided by crc32, can be extended to use MD5 instead

 

zlib - A Massively Spiffy Yet Delicately Unobtrusive Compression Library (Also Free, Not to Mention Unencumbered by Patents)

bzip2 - is a freely available, patent free (see below), high-quality data compressor. It typically compresses files to within 10% to 15% of the best available techniques (the PPM family of statistical compressors), whilst being around twice as fast at compression and six times faster at decompression.

lzo -

  • LZO is a portable lossless data compression library written in ANSI C.
  • Reliable and thoroughly tested. High adoption - each second terrabytes of data are compressed by LZO. No bugs since the first release back in 1996.
  • Offers pretty fast compression and *extremely* fast decompression.
  • Includes slower compression levels achieving a quite competitive compression ratio while still decompressing at this very high speed.
  • Distributed under the terms of the GNU General Public License (GPL v2+). Commercial licenses are available on request.
  • Military-grade stability and robustness.

crc32 - Generate a table for a byte-wise 32-bit CRC calculation on the polynomial:
  x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.

Polynomials over GF(2) are represented in binary, one bit per coefficient,  with the lowest powers in the most significant bit.
Then adding polynomials is just exclusive-or, and multiplying a polynomial by x is a right shift by one.
If we call the above polynomial p, and represent a byte as the polynomial q, also with the lowest power in the most significant bit (so the byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, where a mod b means the remainder after dividing a by b.

This calculation is done using the shift-register method of multiplying and taking the remainder.  The register is initialized to zero, and for each incoming bit, x^32 is added mod p to the register if the bit is a one (where x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by x (which is shifting right by one and adding x^32 mod p if the bit shifted out is a one).
We start with the highest power (least significant bit) of q and repeat for all eight bits of q.

The table is simply the CRC of all possible eight bit values.
This is all the information needed to generate CRC's on data a byte at a time for all
  combinations of CRC register values and incoming bytes.
 
(This description come from the sources of Zlib compression )


Documentation

/// <summary>
/// It will compress the buffer
/// </summary>
/// <param name="inbuf">the buffer to compress</param>
/// <param name="insize">the size of the input buffer</param>
/// <param name="outbuf">the output buffer</param>
/// <param name="outsize">the size of the output buffer</param>
/// <param name="format">the method to compress</param>
/// <returns>0 if no error</returns>
[DllImport("rspmfce.dll")]
public static extern int
string_compress(ref byte inbuf, int insize, ref byte outbuf,
ref int outsize, int format);
/// <summary>
/// It will retrieve the uncompressed required size
/// </summary>
/// <param name="inbuf">the buffer to uncompress</param>
/// <param name="insize">the size of the input buffer</param>
/// <param name="outsize">the size of the output buffer</param>
/// <returns>0 if no error</returns>
[DllImport("rspmfce.dll")]
public static extern int
string_uncompress_size(ref byte inbuf, int insize, ref int outsize);
/// <summary>
/// It will uncompress the buffer
/// </summary>
/// <param name="inbuf">the buffer to uncompress</param>
/// <param name="insize">the size of the input buffer</param>
/// <param name="outbuf">the uncompressed output buffer</param>
/// <param name="outsize">the size of the output buffer</param>
/// <returns>0 if no error</returns>
[DllImport("rspmfce.dll")]
public static extern int
string_uncompress(ref byte inbuf, int insize, ref byte outbuf, ref int outsize);
/// <summary>
/// It will retrieve the compressed size of the buffer
/// </summary>
/// <param name="inbuf">the buffer to compress</param>
/// <param name="insize">the size of the input buffer</param>
/// <param name="outsize">the size of the output buffer</param>
/// <param name="format">the method to compress</param>
/// <returns>0 if no error</returns>
[DllImport("rspmfce.dll")]
public static extern int
string_compress_size(ref byte inbuf, int insize, ref int outsize, int format);


Install

Install

- Extract the files to an empty folder

Operating System Compliance

Windows 2000 , Windows XP, Windows Vista, Windows 7


Download

RSPmfce Files

 


Email
arab@rspsoftware.com.br

Phone

#55 41 96802731

Thanks for using our software

RSP Software 2009