Simply compressor, support zlib/gzip/flate/lzw.
To install the package, run:
go get github.com/go-zoox/compress
package main
import (
"fmt"
"github.com/go-zoox/compress"
)
func main() {
gzip := compress.NewGzip()
bytes := gzip.Compress([]byte("hello world"))
bytes2, _ := gzip.Decompress(bytes)
fmt.Println(string(bytes2))
}
Try in Go Playground.
- cosiner/gohper - common libs here
GoZoox is released under the MIT License.