Nim implementation of Snappy compression algorithm
Go to file
andri lim 4378d9fc93 make test green 2019-09-03 12:32:26 +03:00
tests make test green 2019-09-03 12:32:26 +03:00
.appveyor.yml CI fixes 2019-08-24 18:49:48 +02:00
.gitignore initial commit 2018-11-02 12:10:58 +07:00
.travis.yml CI: update script path 2019-08-24 18:30:34 +02: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 make test green 2019-09-03 12:32:26 +03:00
snappy.nimble Nimble fix 2019-08-24 18:58:12 +02: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