Nim implementation of Snappy compression algorithm
Go to file
andri lim 66d13402c1
Merge pull request #1 from jangko/fix_ci
fixes appveyor.yml
2018-11-02 22:06:50 +07:00
tests fixes tests 2018-11-02 21:48:41 +07:00
.appveyor.yml fixes tests 2018-11-02 21:48:41 +07:00
.gitignore initial commit 2018-11-02 12:10:58 +07:00
.travis.yml fixes tests 2018-11-02 21:48:41 +07:00
LICENSE initial commit 2018-11-02 12:10:58 +07:00
readme.md add compress/uncompress alias 2018-11-02 20:36:21 +07:00
snappy.nim add compress/uncompress alias 2018-11-02 20:36:21 +07:00
snappy.nimble fixes tests 2018-11-02 21:48:41 +07:00

readme.md

Snappy

Build Status (Travis) Windows build status (Appveyor) 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