1 Introduction
compress
uncompress
valid-compression?
2 History
3 Legal
Version: 1:0

snappy: fast compression/decompression

Stephen Chang and Asumu Takikawa

 (require (planet plt/snappy:1:0))

1 Introduction

This is an FFI binding for the Snappy library from Google. Snappy provides very fast compression and decompression, though with larger compressed sizes.

procedure

(compress input)  bytes?

  input : bytes?
Compresses the input bytestring and returns the resulting bytestring.

procedure

(uncompress input)  bytes?

  input : (and/c bytes? valid-compression?)
Uncompresses the input bytestring and returns the resulting bytestring. Requires that the input bytestring was the result of a valid Snappy compression.

procedure

(valid-compression? input)  boolean?

  input : bytes?
Returns #t if input is a compressed bytestring that can be uncompressed with Snappy. Otherwise returns #f.

2 History

3 Legal

Copyright 2012 Stephen Chang & Asumu Takikwa.