Giter Club home page Giter Club logo

smaz's Introduction

This is a pure Go implementation of antirez's SMAZ, a library for compressing short, English strings (it won't work well for other languages).

Installation

$ go get github.com/kjk/smaz

Usage

import (
  "github.com/kjk/smaz"
)

func main() {
  s := "Now is the time for all good men to come to the aid of the party."
  compressed := smaz.Encode(nil, []byte(s))
  decompressed, err := smaz.Decode(nil, compressed)
  if err != nil {
    fmt.Printf("decompressed: %s\n", string(decompressed))
    ...
}

Full API documentation.

Notes

This is not a direct port of the C version. It is not guaranteed that the output of smaz.Encode will be precisely the same as the C library. However, the output should be decompressible by the C library, and the output of the C library should be decompressible by smaz.Decode.

Author

Salvatore Sanfilippo designed SMAZ and wrote [C implementation]](https://github.com/antirez/smaz).

Caleb Spare wrote initial Go port.

Krzysztof Kowalczyk improved speed of decompression (2.4x faster) and compression (1.3x faster).

Contributors

Antoine Grondin

License

MIT Licensed.

Other implementations

smaz's People

Contributors

kjk avatar cespare avatar 0x4139 avatar aybabtme avatar tnarg avatar nytr0gen avatar

Stargazers

Tom avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.