String Compression Question

Stefan Taferner taferner at kde.org
Thu Aug 19 13:22:57 BST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Donnerstag, 19. August 2004 13:39 schrieb Sheraz:
> Hi
>
> My objective is to make a function that will take
> larger string and outputs a compact string....by using
> any compression Algo..
>
> Do we have any library or Algo to achieve this ?
>
> I don't want file compression i need to perform
> compression/decompression over a string

Depends on the string length. The Huffman algorithm
has an extra header. This would only pay off if the
string is at least several KB long. If this is so, you
could take a look at the zlib. Still work to do for you,
but it is possible to work on memory buffers with this.
Plus its quite wide-spread nowadays, IMO.

Kind regards,
Stefan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBJJulyFGHHVZzCLwRAmD+AJ9NEiYjrFH0nwayNTLdGLtfahjjMgCfYQ7i
8MWGeJCLOy0HeGbA8XQqK+A=
=E/u3
-----END PGP SIGNATURE-----




More information about the kde-core-devel mailing list