Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/cespare/go-smaz

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/cespare/go-smaz

  • v1.0.0
  • Source
  • Go
  • Socket score

Version published
Created
Source

go-smaz

Go Reference

go-smaz is a pure Go implementation of antirez's smaz, a library for compressing short strings (particularly containing English words).

Installation

go get github.com/cespare/go-smaz

Usage

import (
  "github.com/cespare/go-smaz"
)

func main() {
  s := "Now is the time for all good men to come to the aid of the party."
  compressed := smaz.Compress([]byte(s))           // type is []byte
  decompressed, err := smaz.Decompress(compressed) // type is []byte; string(decompressed) == s
  if err != nil {
    ...
}

Also see the API documentation.

Notes

go-smaz is not a direct port of the C version. It is not guaranteed that the output of smaz.Compress 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.Decompress.

Author

Caleb Spare (cespare). smaz was created by Salvatore Sanfilippo (antirez).

Contributors

License

MIT Licensed.

Other implementations

FAQs

Package last updated on 01 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc