Snappy (previously known as Zippy) is a fast data compression and decompression library written in C++ by Google based on ideas from LZ77 and open-sourced in 2011.
It can be used in open-source projects like MariaDB ColumnStore,[6] Cassandra, Couchbase, Hadoop, LevelDB, MongoDB, RocksDB, Lucene, Spark, InfluxDB,[7] and Ceph.
The first bytes of the stream are the length of uncompressed data, stored as a little-endian varint,[11]: section 1 which allows for use of a variable-length code.
[citation needed] The complete official description of the snappy format can be found in the google GitHub repository.
[11] The text Wikipedia is a free, web-based, collaborative, multilingual encyclopedia project.may be compressed to this, shown as hex data with explanations: The stream starts with the length of the uncompressed data as a varint[11]: section 1 – thus the first byte, with the high bit clear, corresponds to a length of 5116=81 bytes.
To combat these issues, the Snappy framing format[2] "Snappy framed" may be used, which breaks the input into chunks of up to 64KiB,[2]: 4.2,4.3 delimited by 4-byte block headers (a one-byte identifier and three-byte length):[2]: section 1 Both types of data chunk also contain a CRC-32C checksum of the uncompressed data.
Third party-provided bindings and ports include[13] C#, Common Lisp, Crystal (programming language), Erlang, Go, Haskell, Lua, Java, Nim, Node.js, Perl, PHP, Python, R, Ruby, Rust, Smalltalk, and OpenCL.