Nim implementation of Snappy compression algorithm
Go to file
Zahary Karadjov 20cc8ce1c2
Export more constants, so they can be used in NBC
2020-05-08 22:24:16 +03:00
snappy Export more constants, so they can be used in NBC 2020-05-08 22:24:16 +03:00
tests Async version of the Snappy framing format based on the latest FastStreams version 2020-05-06 00:35:55 +03:00
.appveyor.yml fixes ci 2020-04-01 22:35:57 +03:00
.gitattributes renormalize *.txt EOL 2020-04-01 22:35:57 +03:00
.gitignore modify .gitignore 2020-04-01 22:35:57 +03:00
.travis.yml fixes ci 2020-04-01 22:35:57 +03:00
LICENSE initial commit 2018-11-02 12:10:58 +07:00
README.md update CI badges 2019-08-24 18:35:53 +02:00
snappy.nim Async version of the Snappy framing format based on the latest FastStreams version 2020-05-06 00:35:55 +03:00
snappy.nimble Use the latest faststreams OutputStream API 2020-04-13 15:02:41 +03:00

README.md

Snappy

Build Status Build status nimble license

Nim implementation of Snappy compression algorithm

Currently, this implementation only support block compression and no stream compression support at all.

API

  • proc encode*(src: openArray[byte]): seq[byte]
  • proc decode*(src: openArray[byte]): seq[byte]
  • template compress --- an alias to encode
  • template uncompress --- an alias to decode

Examples

import snappy
var source = readFile("readme.md")
var encoded = snappy.encode(toOpenArrayByte(source, 0, source.len-1))
var decoded = snappy.decode(encoded)
assert equalMem(decoded[0].addr, source[0].addr, source.len)

Installation via nimble

nimble install snappy