Skip to content
Browse files

README and COPYING added

  • Loading branch information...
1 parent 150e125 commit a83b209b33ebc8025dbf1bfd1232ad1ec723e9ff @antirez committed
Showing with 52 additions and 0 deletions.
  1. +10 −0 COPYING
  2. +42 −0 README
View
10 COPYING
@@ -0,0 +1,10 @@
+Copyright (c) 2006-2009, Salvatore Sanfilippo
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ * Neither the name of Smaz nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
View
42 README
@@ -0,0 +1,42 @@
+SMAZ - compression for very small strings
+-----------------------------------------
+
+Smaz is a simple compression library suitable for compressing very short
+strings. General purposes compression libraries will build the state needed
+for compressing data dynamically, in order to be able to compress every kind
+of data. This is a very good idea, but not for a specific problem: compressing
+small strings will not work.
+
+Smaz instead is not good for compressing general purpose data, but can compress
+text by 40-50% in the average case (works better with English), and is able to
+perform a bit of compression for HTML and urls as well. The important point is
+that Smaz is able to compress even strings of two or three bytes!
+
+For example the string "the" is compressed into a single byte.
+
+USAGE
+-----
+
+The lib consists of just two functions:
+
+ int smaz_compress(char *in, int inlen, char *out, int outlen);
+
+Compress the buffer 'in' of length 'inlen' and put the compressed data into
+'out' of max length 'outlen' bytes. If the output buffer is too short to hold
+the whole compressed string, outlen+1 is returned. Otherwise the length of the
+compressed string (less then or equal to outlen) is returned.
+
+ int smaz_decompress(char *in, int inlen, char *out, int outlen);
+
+Decompress the buffer 'in' of length 'inlen' and put the decompressed data into
+'out' of max length 'outlen' bytes. If the output buffer is too short to hold
+the whole decompressed string, outlen+1 is returned. Otherwise the length of the
+compressed string (less then or equal to outlen) is returned. This function will
+not automatically put a nul-term at the end of the string if the original
+compressed string didn't included a nulterm.
+
+
+CREDITS
+-------
+
+Small was writte by Salvatore Sanfilippo and is released under the BSD license. Check the COPYING file for more information.

0 comments on commit a83b209

Please sign in to comment.
Something went wrong with that request. Please try again.