Snappywrap.Framing (snappywrap v0.1.1)

View Source

The Snappy framing format is an optional Snappy format.

It consists of a stream identifier header 0xff 0x06 0x00 0x00 0x73 0x4e 0x61 0x50 0x70 0x59, followed by a series of chunks. In this wrapper implementation, each chunk can only be an uncompressed data chunk (identifier: 0x01).

Snappy chunks have the following format:

  • 1 byte: chunk type (0x01 for uncompressed data)
  • 3 bytes: chunk length (little-endian)
  • 4 bytes: masked CRC-32C checksum of the chunk data
  • N bytes: chunk data

Summary

Functions

Encodes as uncompressed data in Snappy framing format.

Functions

encode(data)

Encodes as uncompressed data in Snappy framing format.

Input data size is assumed to be valid.